Branch Coverage

blib/lib/SHARYANTO/SQL/Schema.pm
Criterion Covered Total %
branch 45 90 50.0


line true false branch
126 0 0 @$_sahv_dpath ? :
1 0 &Scalar::Util::Numeric::isint($args{'create_from_version'}) ? :
0 0 @$_sahv_dpath ? :
1 0 defined $args{'create_from_version'} ? :
1 0 if defined $args{'create_from_version'} ? 1 : ($arg_err //= (@$_sahv_dpath ? '@' . join('/', @$_sahv_dpath) . ': ' : '') . 'Required input not specified', 0)
0 1 if ($arg_err)
1 6 if (exists $args{'create_from_version'})
0 7 unless (exists $args{'dbh'})
0 0 @$_sahv_dpath ? :
7 0 &Scalar::Util::blessed($args{'dbh'}) ? :
0 0 @$_sahv_dpath ? :
7 0 defined $args{'dbh'} ? :
7 0 if defined $args{'dbh'} ? 1 : ($arg_err //= (@$_sahv_dpath ? '@' . join('/', @$_sahv_dpath) . ': ' : '') . 'Required input not specified', 0)
0 7 if ($arg_err)
0 7 unless (exists $args{'spec'})
0 0 @$_sahv_dpath ? :
7 0 ref $args{'spec'} eq 'HASH' ? :
0 0 @$_sahv_dpath ? :
7 0 defined $args{'spec'} ? :
7 0 if defined $args{'spec'} ? 1 : ($arg_err //= (@$_sahv_dpath ? '@' . join('/', @$_sahv_dpath) . ': ' : '') . 'Required input not specified', 0)
0 7 if ($arg_err)
140 2 5 if (@has_meta_table)
153 0 7 unless (defined $latest_v)
156 0 0 unless /^upgrade_to_v(\d+)$/
157 0 0 if $1 > $latest_v
163 4 11 if $current_v >= $latest_v
168 5 6 if ($current_v == 0)
170 5 0 unless (@has_meta_table)
172 0 5 unless ($dbh->do('CREATE TABLE meta (name VARCHAR(64) NOT NULL PRIMARY KEY, value VARCHAR(255))'))
174 0 5 unless ($dbh->do(q[INSERT INTO meta (name,value) VALUES ('schema_version',0)]))
177 1 4 if ($from_v) { }
179 1 0 if ($$spec{"install_v$from_v"}) { }
182 0 3 unless ($dbh->do($sql))
185 0 1 unless ($dbh->do("UPDATE meta SET value=$from_v WHERE name='schema_version'"))
186 0 1 unless ($dbh->commit)
195 1 3 if ($$spec{'install'}) { }
3 0 elsif ($$spec{'upgrade_to_v1'}) { }
198 0 2 unless ($dbh->do($sql))
201 0 1 unless ($dbh->do("UPDATE meta SET value=$latest_v WHERE name='schema_version'"))
202 0 1 unless ($dbh->commit)
219 0 9 unless ($$spec{"upgrade_to_v$next_v"})
221 2 15 unless ($dbh->do($sql))
224 0 7 unless ($dbh->do("UPDATE meta SET value=$next_v WHERE name='schema_version'"))
225 0 7 unless ($dbh->commit)
228 2 5 if ($err) { }