()
| 529 | } |
| 530 | |
| 531 | protected async discoverMigrations(): Promise<RunnableMigration[]> { |
| 532 | if (this.options.migrationsList) { |
| 533 | return this.options.migrationsList.map(migration => { |
| 534 | if (typeof migration === 'function') { |
| 535 | return this.initialize(migration, migration.name); |
| 536 | } |
| 537 | |
| 538 | return this.initialize(migration.class, migration.name); |
| 539 | }); |
| 540 | } |
| 541 | |
| 542 | const { fs } = await import('@mikro-orm/core/fs-utils'); |
| 543 | const pattern = fs.normalizePath(this.absolutePath, this.options.glob!); |
| 544 | const files: string[] = fs.glob(pattern).sort(); |
| 545 | |
| 546 | return files.map(filePath => |
| 547 | this.resolve({ |
| 548 | name: filePath.replace(/\\/g, '/').split('/').pop()!, |
| 549 | path: filePath, |
| 550 | }), |
| 551 | ); |
| 552 | } |
| 553 | |
| 554 | private async executeMigrations( |
| 555 | method: 'up' | 'down', |
nothing calls this directly
no test coverage detected