| 1 | package DBIO::DeploymentHandler::VersionStorage::Standard::VersionResult; | ||||||||||
| 2 | # ABSTRACT: The typical way to store versions in the database | ||||||||||
| 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::Core'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 4 | my $table = 'dbio_deploymenthandler_versions'; | |||||||||
| 12 | |||||||||||
| 13 | 4 | __PACKAGE__->table($table); | |||||||||
| 14 | |||||||||||
| 15 | 4 | __PACKAGE__->add_columns ( | |||||||||
| 16 | id => { | ||||||||||
| 17 | data_type => 'int', | ||||||||||
| 18 | is_auto_increment => 1, | ||||||||||
| 19 | }, | ||||||||||
| 20 | version => { | ||||||||||
| 21 | data_type => 'varchar', | ||||||||||
| 22 | size => '50', | ||||||||||
| 23 | }, | ||||||||||
| 24 | ddl => { | ||||||||||
| 25 | data_type => 'text', | ||||||||||
| 26 | is_nullable => 1, | ||||||||||
| 27 | }, | ||||||||||
| 28 | upgrade_sql => { | ||||||||||
| 29 | data_type => 'text', | ||||||||||
| 30 | is_nullable => 1, | ||||||||||
| 31 | }, | ||||||||||
| 32 | ); | ||||||||||
| 33 | |||||||||||
| 34 | 4 | __PACKAGE__->set_primary_key('id'); | |||||||||
| 35 | 4 | __PACKAGE__->add_unique_constraint(['version']); | |||||||||
| 36 | 4 | __PACKAGE__->resultset_class('DBIO::DeploymentHandler::VersionStorage::Standard::VersionResultSet'); | |||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | sub sqlt_deploy_hook { | ||||||||
|
Subroutine
sqlt_deploy_hook: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 40 | 0 | my ( $self, $sqlt_table ) = @_; | |||||||||
| 41 | 0 | my $tname = $sqlt_table->name; | |||||||||
| 42 | 0 | ▶ | return if $tname eq $table; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | 0 | foreach my $c ( $sqlt_table->get_constraints ) { | |||||||||
| 44 | 0 | ( my $cname = $c->name ) =~ s/\Q$table\E/$tname/; | |||||||||
| 45 | 0 | $c->name($cname); | |||||||||
| 46 | } | ||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 4 | 1; | |||||||||
| 50 | |||||||||||
| 51 | # vim: ts=2 sw=2 expandtab | ||||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||