| 1 | package DBIx::ThinSQL::Drop; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Path::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use DBIx::ThinSQL::Deploy; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | our $VERSION = '0.0.49'; | |||||||||
| 8 | |||||||||||
| 9 | 29 | ▶ | sub _doit { | ||||||||
|
Subroutine
_doit: called CC=2 SCAR=6.9
| |||||||||||
| 10 | 29 | my $self = shift; | |||||||||
| 11 | 29 | my $type = shift; | |||||||||
| 12 | 29 | my $driver = $self->{Driver}->{Name}; | |||||||||
| 13 | 29 | my $file = $self->share_dir->child( 'Drop', $driver, $type . '.sql' ); | |||||||||
| 14 | |||||||||||
| 15 | 29 | ▶ | return $self->run_file($file) if -f $file; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 1 | Carp::croak "Drop $type for driver $driver is unsupported."; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_indexes { | ||||||||
|
Subroutine
drop_indexes: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 0 | my $self = shift; | |||||||||
| 21 | 0 | return _doit( $self, 'indexes' ); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_functions { | ||||||||
|
Subroutine
drop_functions: not called CC=1 SCAR=6.9
| |||||||||||
| 25 | 0 | my $self = shift; | |||||||||
| 26 | 0 | return _doit( $self, 'functions' ); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_languages { | ||||||||
|
Subroutine
drop_languages: not called CC=1 SCAR=6.9
| |||||||||||
| 30 | 0 | my $self = shift; | |||||||||
| 31 | 0 | return _doit( $self, 'languages' ); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_sequences { | ||||||||
|
Subroutine
drop_sequences: not called CC=1 SCAR=6.9
| |||||||||||
| 35 | 0 | my $self = shift; | |||||||||
| 36 | 0 | return _doit( $self, 'sequences' ); | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_tables { | ||||||||
|
Subroutine
drop_tables: not called CC=1 SCAR=6.9
| |||||||||||
| 40 | 0 | my $self = shift; | |||||||||
| 41 | 0 | return _doit( $self, 'tables' ); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_triggers { | ||||||||
|
Subroutine
drop_triggers: not called CC=1 SCAR=6.9
| |||||||||||
| 45 | 0 | my $self = shift; | |||||||||
| 46 | 0 | return _doit( $self, 'triggers' ); | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 0 | ▶ | sub DBIx::ThinSQL::db::drop_views { | ||||||||
|
Subroutine
drop_views: not called CC=1 SCAR=6.9
| |||||||||||
| 50 | 0 | my $self = shift; | |||||||||
| 51 | 0 | return _doit( $self, 'views' ); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 5 | ▶ | sub DBIx::ThinSQL::db::drop_everything { | ||||||||
|
Subroutine
drop_everything: called CC=1 SCAR=0.0
| |||||||||||
| 55 | 5 | my $self = shift; | |||||||||
| 56 | 5 | return _doit( $self, 'indexes' ) + | |||||||||
| 57 | _doit( $self, 'functions' ) + | ||||||||||
| 58 | _doit( $self, 'languages' ) + | ||||||||||
| 59 | _doit( $self, 'sequences' ) + | ||||||||||
| 60 | _doit( $self, 'tables' ) + | ||||||||||
| 61 | _doit( $self, 'triggers' ) + | ||||||||||
| 62 | _doit( $self, 'views' ); | ||||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 2 | 1; | |||||||||
| 66 | |||||||||||
| 67 | __END__ | ||||||||||