fix: handle migrations .js naming
This commit is contained in:
parent
4dc7e05373
commit
22fa5c9b23
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user