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