| 1 | package DBIx::SimpleMigration::Client::SQLite; | ||||||||||
| 2 | 1 | ▶ | use parent qw(DBIx::SimpleMigration::Client); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | our $VERSION = '1.0.2'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | sub _migrations_table_exists { | ||||||||
|
Subroutine
_migrations_table_exists: called CC=2 SCAR=7.0
| |||||||||||
| 9 | 1 | my ($self) = @_; | |||||||||
| 10 | |||||||||||
| 11 | 1 | my $query = " | |||||||||
| 12 | SELECT EXISTS ( | ||||||||||
| 13 | SELECT NULL | ||||||||||
| 14 | FROM sqlite_master | ||||||||||
| 15 | WHERE type = 'table' AND name = ? | ||||||||||
| 16 | ) | ||||||||||
| 17 | "; | ||||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | my $row = $self->{dbh}->selectrow_hashref($query, {}, $self->{_options}->{migrations_table}) or croak __PACKAGE__ . ': Database error: ' . $self->{dbh}->errstr; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | 1 | return $row->{exists}; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 1 | 1; | |||||||||