line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SQL::Admin::Catalog::Table::ForeignKey; |
3
|
2
|
|
|
2
|
|
1205
|
use base qw( SQL::Admin::Catalog::Table::Constraint ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
149
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
50
|
|
6
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
725
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = v0.5.0; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
###################################################################### |
11
|
|
|
|
|
|
|
###################################################################### |
12
|
|
|
|
|
|
|
sub _constraint_type { # ; |
13
|
4
|
|
|
4
|
|
12
|
'foreign_key'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
###################################################################### |
18
|
|
|
|
|
|
|
###################################################################### |
19
|
|
|
|
|
|
|
sub fullname { # ; |
20
|
4
|
|
|
4
|
0
|
680
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
4
|
50
|
|
|
|
9
|
$self->SUPER::fullname |
23
|
|
|
|
|
|
|
. '{' |
24
|
|
|
|
|
|
|
. join ('.', grep $_, ( |
25
|
|
|
|
|
|
|
$self->referenced_table->fullname, |
26
|
4
|
50
|
|
|
|
22
|
(map join ('-', ref $_ ? @$_ : $_), @{ $self->referenced_column_list || [] }), |
27
|
|
|
|
|
|
|
)) . '}'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
###################################################################### |
32
|
|
|
|
|
|
|
###################################################################### |
33
|
|
|
|
|
|
|
sub referencing_column_list { # ; |
34
|
2
|
|
|
2
|
0
|
17
|
shift->column_list (@_); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
###################################################################### |
39
|
|
|
|
|
|
|
###################################################################### |
40
|
|
|
|
|
|
|
sub referenced_table { # ; |
41
|
5
|
|
|
5
|
0
|
9
|
my $self = shift; |
42
|
5
|
100
|
|
|
|
13
|
$self->{referenced_table} = shift if @_; |
43
|
5
|
|
|
|
|
22
|
$self->{referenced_table}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
###################################################################### |
48
|
|
|
|
|
|
|
###################################################################### |
49
|
|
|
|
|
|
|
sub referenced_column_list { # ; |
50
|
6
|
|
|
6
|
0
|
8
|
my $self = shift; |
51
|
6
|
100
|
|
|
|
18
|
$self->{referenced_column_list} = shift if @_; |
52
|
6
|
|
|
|
|
56
|
$self->{referenced_column_list}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
###################################################################### |
57
|
|
|
|
|
|
|
###################################################################### |
58
|
|
|
|
|
|
|
sub update_rule { # ; |
59
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
60
|
2
|
100
|
|
|
|
9
|
$self->{update_rule} = shift if @_; |
61
|
2
|
|
|
|
|
11
|
$self->{update_rule}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
###################################################################### |
66
|
|
|
|
|
|
|
###################################################################### |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub delete_rule { # ; |
69
|
2
|
|
|
2
|
0
|
4
|
my $self = shift; |
70
|
2
|
100
|
|
|
|
19
|
$self->{delete_rule} = shift if @_; |
71
|
2
|
|
|
|
|
13
|
$self->{delete_rule}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
###################################################################### |
76
|
|
|
|
|
|
|
###################################################################### |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
package SQL::Admin::Catalog::Table::ForeignKey; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |