fix: handle migrations .js naming
This commit is contained in:
		| @@ -13,14 +13,14 @@ module.exports = { | |||||||
|    */ |    */ | ||||||
|   async getMigrations() { |   async getMigrations() { | ||||||
|     const migrationFiles = await fs.readdir(baseMigrationPath) |     const migrationFiles = await fs.readdir(baseMigrationPath) | ||||||
|     return migrationFiles.sort(semver.compare).map(m => ({ |     return migrationFiles.map(m => m.replace('.js', '')).sort(semver.compare).map(m => ({ | ||||||
|       file: m, |       file: m, | ||||||
|       directory: baseMigrationPath |       directory: baseMigrationPath | ||||||
|     })) |     })) | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|   getMigrationName(migration) { |   getMigrationName(migration) { | ||||||
|     return migration.file |     return migration.file.indexOf('.js') >= 0 ? migration.file : `${migration.file}.js` | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|   getMigration(migration) { |   getMigration(migration) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user