|
Lines 12-28
sub pending_migrations {
Link Here
|
| 12 |
my @pending_migrations; |
12 |
my @pending_migrations; |
| 13 |
my $executed_migrations = {}; |
13 |
my $executed_migrations = {}; |
| 14 |
eval { |
14 |
eval { |
| 15 |
$executed_migrations = $dbh->selectall_hashref('SELECT * FROM executed_migrations', 'name'); |
15 |
$executed_migrations = $dbh->selectall_hashref('SELECT name FROM executed_migrations', 'name'); |
| 16 |
}; |
16 |
}; |
| 17 |
|
17 |
|
| 18 |
opendir(my $dh, $self->migrations_dir); |
18 |
opendir(my $dh, $self->migrations_dir); |
| 19 |
foreach my $file (sort readdir $dh) { |
19 |
foreach my $file (readdir $dh) { |
| 20 |
next if $file !~ /\.pl$/; |
20 |
next if $file !~ /\.pl$/; |
| 21 |
next if (exists ($executed_migrations->{$file})); |
21 |
next if (exists ($executed_migrations->{$file})); |
| 22 |
push @pending_migrations, $file; |
22 |
push @pending_migrations, $file; |
| 23 |
} |
23 |
} |
| 24 |
closedir($dh); |
24 |
closedir($dh); |
| 25 |
|
25 |
|
|
|
26 |
@pending_migrations = sort @pending_migrations; |
| 27 |
|
| 26 |
return @pending_migrations; |
28 |
return @pending_migrations; |
| 27 |
} |
29 |
} |
| 28 |
|
30 |
|
| 29 |
- |
|
|