« blib/lib/DBIO/Storage/Async/TransactionContext.pm
↑ Summary
blib/lib/DBIO/Test/AsyncParity/Cases.pm »
| 1 | package DBIO::ChangeLog::Entry; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: ResultSource definition for per-source changelog tables | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 12 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 12 | ▶ | use DBIO::ChangeLog::Table; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 56 | ▶ | sub source_definition { | ||||||||||||||||||||||||||
|
Subroutine
source_definition: called CC=3 SCAR=11.8
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 56 | my ($class, %args) = @_; | |||||||||||||||||||||||||||
| 15 | 56 | my $table = $args{table}; | |||||||||||||||||||||||||||
| 16 | 56 | require Carp; | |||||||||||||||||||||||||||
| 17 | 56 | ▶ | Carp::croak("source_definition requires 'table' argument") | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $table and length $table
MC/DC0%0/2
defined $table and length $table
defined $table
length $table
Truth table33%1/3
A and B
A= defined $tableB= length $table
| |||||||||||||||||||||||||||||
| 18 | unless defined $table && length $table; | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 56 | return DBIO::ChangeLog::Table->build_source({ | |||||||||||||||||||||||||||
| 21 | table => "${table}_changelog", | ||||||||||||||||||||||||||||
| 22 | columns => { | ||||||||||||||||||||||||||||
| 23 | id => { | ||||||||||||||||||||||||||||
| 24 | data_type => 'integer', | ||||||||||||||||||||||||||||
| 25 | is_auto_increment => 1, | ||||||||||||||||||||||||||||
| 26 | }, | ||||||||||||||||||||||||||||
| 27 | changeset_id => { | ||||||||||||||||||||||||||||
| 28 | data_type => 'integer', | ||||||||||||||||||||||||||||
| 29 | is_nullable => 1, | ||||||||||||||||||||||||||||
| 30 | }, | ||||||||||||||||||||||||||||
| 31 | row_id => { | ||||||||||||||||||||||||||||
| 32 | data_type => 'varchar', | ||||||||||||||||||||||||||||
| 33 | size => 255, | ||||||||||||||||||||||||||||
| 34 | is_nullable => 0, | ||||||||||||||||||||||||||||
| 35 | }, | ||||||||||||||||||||||||||||
| 36 | event => { | ||||||||||||||||||||||||||||
| 37 | data_type => 'varchar', | ||||||||||||||||||||||||||||
| 38 | size => 64, | ||||||||||||||||||||||||||||
| 39 | is_nullable => 0, | ||||||||||||||||||||||||||||
| 40 | }, | ||||||||||||||||||||||||||||
| 41 | changes => { | ||||||||||||||||||||||||||||
| 42 | data_type => 'text', | ||||||||||||||||||||||||||||
| 43 | is_nullable => 1, | ||||||||||||||||||||||||||||
| 44 | }, | ||||||||||||||||||||||||||||
| 45 | created_at => { | ||||||||||||||||||||||||||||
| 46 | data_type => 'datetime', | ||||||||||||||||||||||||||||
| 47 | is_nullable => 0, | ||||||||||||||||||||||||||||
| 48 | }, | ||||||||||||||||||||||||||||
| 49 | }, | ||||||||||||||||||||||||||||
| 50 | column_order => [qw/ id changeset_id row_id event changes created_at /], | ||||||||||||||||||||||||||||
| 51 | primary_key => ['id'], | ||||||||||||||||||||||||||||
| 52 | }); | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 12 | 1; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||||||||||