Commit 22fa5c9b authored by NGPixel's avatar NGPixel

fix: handle migrations .js naming

parent 4dc7e053
......@@ -13,14 +13,14 @@ module.exports = {
*/
async getMigrations() {
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,
directory: baseMigrationPath
}))
},
getMigrationName(migration) {
return migration.file
return migration.file.indexOf('.js') >= 0 ? migration.file : `${migration.file}.js`
},
getMigration(migration) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment