Skip to content

Commit

Permalink
Use regex to determine which files to treat as migration files (Namel…
Browse files Browse the repository at this point in the history
  • Loading branch information
tadhgboyle authored Apr 4, 2023
1 parent c4a7d43 commit 1ce948f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/classes/Database/PhinxAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ static function ($file_name) {
return $version . '_' . $migration_name;
},
array_filter(scandir(__DIR__ . '/../../migrations'), static function ($file_name) {
return !in_array($file_name, ['.', '..', 'phinx.php']);
// Pattern that matches Phinx migration file names (eg: 20230403000000_create_stroopwafel_table.php)
return preg_match('/^\d{14}_\w+\.php$/', $file_name);
}),
);

Expand Down

0 comments on commit 1ce948f

Please sign in to comment.