DeploymentHandler/VersionStorage/Standard/VersionResult.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.6% 29 / 30 CC 3 SCAR 6.9
CC
3
Cov
100%
sqlt_deploy_hook
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« DeploymentHandler/Dad.pm ↑ Summary DeploymentHandler.pm »
1 package DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult;
2 19 $DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult::VERSION = '0.002233';
3 # ABSTRACT: The typical way to store versions in the database
4  
5 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 19 ▶use parent 'DBIx::Class::Core';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 19 my $table = 'dbix_class_deploymenthandler_versions';
11  
12 19 __PACKAGE__->table($table);
13  
14 19 __PACKAGE__->add_columns (
15 id => {
16 data_type => 'int',
17 is_auto_increment => 1,
18 },
19 version => {
20 data_type => 'varchar',
21 # size needs to be at least
22 # 40 to support SHA1 versions
23 size => '50'
24 },
25 ddl => {
26 data_type => 'text',
27 is_nullable => 1,
28 },
29 upgrade_sql => {
30 data_type => 'text',
31 is_nullable => 1,
32 },
33 );
34  
35 19 __PACKAGE__->set_primary_key('id');
36 19 __PACKAGE__->add_unique_constraint(['version']);
37 19 __PACKAGE__->resultset_class('DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet');
38  
39 sub sqlt_deploy_hook {
40 31 ▶ my ( $self, $sqlt_table ) = @_;
Subroutine sqlt_deploy_hook: called CC=3 SCAR=11.0
Pod undocumented
41 31 my $tname = $sqlt_table->name;
42 31 ▶ return if $tname eq $table;
Branch: 1 branch
BranchTrueFalseTotal
if $tname eq $table 26 5 31
43 # give indices unique names for sub-classes on different tables
44 5 foreach my $c ( $sqlt_table->get_constraints ) {
45 10 ( my $cname = $c->name ) =~ s/\Q$table\E/$tname/;
46 10 $c->name($cname);
47 }
48 }
49  
50 19 1;
51  
52 # vim: ts=2 sw=2 expandtab
53  
54 __END__
55  
56 =pod
57  
58 =head1 NAME
59  
60 DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult - The typical way to store versions in the database
61  
62 =head1 AUTHOR
63  
64 Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
65  
66 =head1 COPYRIGHT AND LICENSE
67  
68 This software is copyright (c) 2019 by Arthur Axel "fREW" Schmidt.
69  
70 This is free software; you can redistribute it and/or modify it under
71 the same terms as the Perl 5 programming language system itself.
72  
73 =cut
« DeploymentHandler/Dad.pm ↑ Summary DeploymentHandler.pm »