| 1 | package DBICx::Backend::Move; | ||||||||||||
| 2 | |||||||||||||
| 3 | 3 | ▶ | use 5.010; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | ▶ | use Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 3 | ▶ | use Module::Load 'load'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 3 | ▶ | use DBICx::Deploy; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 3 | our $VERSION = 1.00010; | |||||||||||
| 11 | |||||||||||||
| 12 | sub deploy | ||||||||||||
| 13 | 2 | ▶ | { | ||||||||||
|
Subroutine
deploy: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 14 | 2 | my ( $self, $schema, $dsn, @args ) = @_; | |||||||||||
| 15 | 2 | load $schema; | |||||||||||
| 16 | 2 | DBICx::Deploy->deploy($schema, $dsn, @args); | |||||||||||
| 17 | 2 | return; | |||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | |||||||||||||
| 21 | sub transfer_data | ||||||||||||
| 22 | 2 | ▶ | { | ||||||||||
|
Subroutine
transfer_data: called CC=11 SCAR=24.1
Pod
undocumented
| |||||||||||||
| 23 | 2 | my ( $self, $from, $to, $opt ) = @_; | |||||||||||
| 24 | |||||||||||||
| 25 | 2 | my $schema = $opt->{schema}; | |||||||||||
| 26 | 2 | ▶ | my $verbose = $opt->{verbose} || 0; | ||||||||||
|
Condition100%2/2
$opt->{'verbose'} || 0
MC/DC100%1/1
$opt->{'verbose'} || 0
$opt->{'verbose'}
Truth table100%2/2
A
A= $opt->{'verbose'}
| |||||||||||||
| 27 | 2 | my $rawmode = $opt->{rawmode}; | |||||||||||
| 28 | |||||||||||||
| 29 | SOURCE: | ||||||||||||
| 30 | 2 | foreach my $source_name ($from->sources) { | |||||||||||
| 31 | 6 | ▶ | print STDERR "Transfer: $source_name => " if $verbose; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 6 | my $source_rs = $from->resultset($source_name); | |||||||||||
| 33 | |||||||||||||
| 34 | 6 | ▶ | if (ref $source_rs->result_source eq 'DBIx::Class::ResultSource::View') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 35 | 2 | ▶ | say STDERR "$source_name is a view. Skipped." if $verbose; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 2 | next SOURCE; | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 4 | ▶ | while (my $row = $source_rs->next) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 40 | 6 | my %source_row; | |||||||||||
| 41 | 6 | ▶ | print STDERR "." if $verbose >= 2; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 42 | 6 | ▶ | %source_row = $rawmode ? $row->get_columns : $row->get_inflated_columns; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 43 | 6 | my $new_row; | |||||||||||
| 44 | 6 | ▶ | if ($rawmode) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 45 | 0 | $new_row = $to->resultset($source_name)->new({}); | |||||||||||
| 46 | 0 | $new_row->set_columns(\%source_row); | |||||||||||
| 47 | } else { | ||||||||||||
| 48 | 6 | $new_row = $to->resultset($source_name)->new(\%source_row); | |||||||||||
| 49 | } | ||||||||||||
| 50 | 6 | $new_row->insert; | |||||||||||
| 51 | } | ||||||||||||
| 52 | 4 | ▶ | print STDERR "done.\n" if $verbose; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 53 | } | ||||||||||||
| 54 | 2 | return; | |||||||||||
| 55 | } | ||||||||||||
| 56 | |||||||||||||
| 57 | 3 | 1; | |||||||||||