Anego/CLI/Migrate.pm

filter: Statementstmt 71.4% 25 / 35 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 1 totaltotal 70.2% 33 / 47 CC 2 SCAR 6.9
CC
2
Cov
68%
run
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Anego/CLI/Version.pm ↑ Summary Anego/CLI/Diff.pm »
1 package Anego::CLI::Migrate;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Anego::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Anego::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Anego::Task::Diff;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Anego::Task::SchemaLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Anego::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub run {
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
13 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 ▶ unless ($diff) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($diff) 0 0 0
21 0 warnf("target schema == database schema, should no differences\n");
22 0 return;
23 }
24  
25 0 do_sql($diff);
26  
27 0 infof "Migrated\n";
28 }
29  
30 1 1;
« Anego/CLI/Version.pm ↑ Summary Anego/CLI/Diff.pm »