From 22fa5c9b23fb2741dff67797bb7a0936e8b55eac Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 26 Jan 2020 21:04:38 -0500 Subject: [PATCH] fix: handle migrations .js naming --- server/db/migrator-source.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/db/migrator-source.js b/server/db/migrator-source.js index 00927f45..8b086653 100644 --- a/server/db/migrator-source.js +++ b/server/db/migrator-source.js @@ -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) {