新增LoadMigrationFiles事件,支持扩展提供的数据库迁移文件

This commit is contained in:
augushong
2024-10-15 18:06:25 +08:00
parent c79ad6b986
commit d0add06ca0
3 changed files with 20 additions and 0 deletions

View File

@@ -104,6 +104,14 @@ abstract class Migrate extends Command
if (null === $this->migrations) {
$phpFiles = glob($this->getPath() . DIRECTORY_SEPARATOR . '*.php', defined('GLOB_BRACE') ? GLOB_BRACE : 0);
$event_files = event_handle_result('LoadMigrationFiles','file_list');
foreach ($event_files as $file_list) {
foreach ($file_list as $file_path) {
$phpFiles[] = $file_path;
}
}
// filter the files to only get the ones that match our naming scheme
$fileNames = [];
/** @var Migrator[] $versions */