line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Util::Lite::ForeignKey; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use Modern::Perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
100
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
5293
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
48
|
use Method::Signatures; |
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
6
|
|
9
|
1
|
|
|
1
|
|
277
|
use Data::Printer alias => 'pdump'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
1442
|
use MySQL::Util::Lite::ColumnConstraint; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has name => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
isa => 'Str', |
15
|
|
|
|
|
|
|
required => 1, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has column_constraints => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => 'ArrayRef[MySQL::Util::Lite::ColumnConstraint]', |
21
|
|
|
|
|
|
|
lazy => 1, |
22
|
|
|
|
|
|
|
builder => '_build_column_constraints', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has _util => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => 'MySQL::Util', |
28
|
|
|
|
|
|
|
required => 1, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
1
|
0
|
|
1
|
|
1078
|
method get_column_constraints { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return @{ $self->column_constraints }; |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
1
|
0
|
|
1
|
|
648
|
method _build_column_constraints { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $aref = $self->_util->get_constraint( |
39
|
|
|
|
|
|
|
name => $self->name |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my @cols; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
foreach my $col (@$aref) { |
45
|
|
|
|
|
|
|
push @cols, MySQL::Util::Lite::ColumnConstraint->new( |
46
|
|
|
|
|
|
|
column_name => $col->{COLUMN_NAME}, |
47
|
|
|
|
|
|
|
table_name => $col->{TABLE_NAME}, |
48
|
|
|
|
|
|
|
schema_name => $col->{CONSTRAINT_SCHEMA}, |
49
|
|
|
|
|
|
|
parent_column_name => $col->{REFERENCED_COLUMN_NAME}, |
50
|
|
|
|
|
|
|
parent_table_name => $col->{REFERENCED_TABLE_NAME}, |
51
|
|
|
|
|
|
|
parent_schema_name => $col->{REFERENCED_TABLE_SCHEMA}, |
52
|
0
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return \@cols; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |