line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Anego::CLI::Diff; |
2
|
1
|
|
|
1
|
|
316
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
17
|
use Anego::Config; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
7
|
1
|
|
|
1
|
|
4
|
use Anego::Logger; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
219
|
use Anego::Task::Diff; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
9
|
1
|
|
|
1
|
|
342
|
use Anego::Task::SchemaLoader; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
10
|
1
|
|
|
1
|
|
232
|
use Anego::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
113
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub run { |
13
|
0
|
|
|
0
|
0
|
|
my ($class, @args) = @_; |
14
|
0
|
|
|
|
|
|
my $config = Anego::Config->load; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $source_schema = Anego::Task::SchemaLoader->database; |
17
|
0
|
|
|
|
|
|
my $target_schema = Anego::Task::SchemaLoader->from(@args); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $diff = Anego::Task::Diff->diff($source_schema, $target_schema); |
20
|
0
|
0
|
|
|
|
|
unless ($diff) { |
21
|
0
|
|
|
|
|
|
warnf("target schema == database schema, should no differences\n"); |
22
|
0
|
|
|
|
|
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
print $diff; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |