blib/lib/DBIO/DeploymentHandler/VersionStorage/Standard.pm

filter: Statementstmt 90.4% 38 / 42 Branchbran 40.0% 4 / 10 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 92.3% 12 / 13 Podpod 100% 9 / 9 totaltotal 83.1% 64 / 77 CC 7 SCAR 7.9
CC
7
Cov
80%
version_class
6.0
new
3.1
schema
2.3
CRAP 2.2
« blib/lib/DBIO/Test/DynamicForeignCols/TestComputer.pm ↑ Summary blib/lib/DBIO/Storage/DBI/Capabilities.pm »
1 package DBIO::DeploymentHandler::VersionStorage::Standard;
2 # ABSTRACT: Standard version storage implementation
3  
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '0.900007';
8  
9 4 ▶use base 'DBIO::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 ▶use DBIO::DeploymentHandler::VersionStorage::Standard::Component;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 9 ▶sub new {
Subroutine new: called CC=3 SCAR=11.2
Pod documented
15 9 my ($class, @args) = @_;
16 9 ▶ my $args = @args == 1 ? $args[0] : { @args };
Branch: 1 branch
BranchTrueFalseTotal
@args == 1 ? : 9 0 9
17 9 my $self = bless({}, $class);
18 9 ▶ $self->{_version_storage_attrs} ||= {};
Condition50%1/2
$self->{"_version_storage_attrs"} ||= {}
l!l
09
MC/DC0%0/1
$self->{"_version_storage_attrs"} ||= {}
$self->{"_version_storage_attrs"}
Truth table50%1/2
A
A= $self->{"_version_storage_attrs"}
Aresult
11
00
19 9 %$self = (%$self, %$args);
20 9 $self;
21 }
22  
23  
24 6 ▶sub schema {
Subroutine schema: called CC=2 SCAR=8.1
Pod documented
25 6 my $self = shift;
26 6 ▶ return $self->{schema} if exists $self->{schema};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"schema"} 6 0 6
27 0 return $self->{_version_storage_attrs}{schema};
28 }
29  
30  
31 7 ▶sub version_source {
Subroutine version_source: called CC=2 SCAR=7.1
Pod documented
32 7 my $self = shift;
33 7 ▶ return $self->{version_source} if exists $self->{version_source};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"version_source"} 0 7 7
34 7 return '__VERSION';
35 }
36  
37  
38 0 ▶sub version_class {
Subroutine version_class: not called CC=2 SCAR=17.9
Pod documented
39 0 my $self = shift;
40 0 ▶ return $self->{version_class} if exists $self->{version_class};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"version_class"} 0 0 0
41 0 return 'DBIO::DeploymentHandler::VersionStorage::Standard::VersionResult';
42 }
43  
44  
45 6 ▶sub version_rs {
Subroutine version_rs: called CC=1 SCAR=0.0
Pod documented
46 6 my $self = shift;
47 6 return $self->schema->resultset($self->version_source);
48 }
49  
50  
51 2 ▶sub version_storage_is_installed {
Subroutine version_storage_is_installed: called CC=1 SCAR=0.0
Pod documented
52 2 my $self = shift;
53 2 $self->version_rs->version_storage_is_installed;
54 }
55  
56 1 ▶sub database_version {
Subroutine database_version: called CC=1 SCAR=0.0
Pod documented
57 1 my $self = shift;
58 1 $self->version_rs->database_version;
59 }
60  
61  
62 1 ▶sub add_database_version {
Subroutine add_database_version: called CC=1 SCAR=0.0
Pod documented
63 1 my $self = shift;
64 1 my $args = shift;
65  
66 $self->version_rs->create({
67 version => $args->{version},
68 ddl => $args->{ddl},
69 upgrade_sql => $args->{upgrade_sql},
70 1 });
71 }
72  
73  
74 1 ▶sub delete_database_version {
Subroutine delete_database_version: called CC=2 SCAR=7.0
Pod documented
75 1 my $self = shift;
76 1 my $args = shift;
77  
78 1 my $rs = $self->version_rs->search({ version => $args->{version} });
79 1 ▶ $rs->delete if $rs->can('delete');
Branch: 1 branch
BranchTrueFalseTotal
if $rs->can("delete") 1 0 1
80 }
81  
82 4 1;
83  
84 # vim: ts=2 sw=2 expandtab
85  
86 __END__
« blib/lib/DBIO/Test/DynamicForeignCols/TestComputer.pm ↑ Summary blib/lib/DBIO/Storage/DBI/Capabilities.pm »