diff options
Diffstat (limited to 'server/initializers/migrator.ts')
-rw-r--r-- | server/initializers/migrator.ts | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts index 71a656c59..7b535aea9 100644 --- a/server/initializers/migrator.ts +++ b/server/initializers/migrator.ts | |||
@@ -64,14 +64,16 @@ function getMigrationScripts () { | |||
64 | script: string | 64 | script: string |
65 | }[] = [] | 65 | }[] = [] |
66 | 66 | ||
67 | files.forEach(file => { | 67 | files |
68 | // Filename is something like 'version-blabla.js' | 68 | .filter(file => file.endsWith('.js.map') === false) |
69 | const version = file.split('-')[0] | 69 | .forEach(file => { |
70 | filesToMigrate.push({ | 70 | // Filename is something like 'version-blabla.js' |
71 | version, | 71 | const version = file.split('-')[0] |
72 | script: file | 72 | filesToMigrate.push({ |
73 | version, | ||
74 | script: file | ||
75 | }) | ||
73 | }) | 76 | }) |
74 | }) | ||
75 | 77 | ||
76 | return filesToMigrate | 78 | return filesToMigrate |
77 | }) | 79 | }) |
@@ -93,7 +95,8 @@ function executeMigration (actualVersion: number, entity: { version: string, scr | |||
93 | const options = { | 95 | const options = { |
94 | transaction: t, | 96 | transaction: t, |
95 | queryInterface: db.sequelize.getQueryInterface(), | 97 | queryInterface: db.sequelize.getQueryInterface(), |
96 | sequelize: db.sequelize | 98 | sequelize: db.sequelize, |
99 | db | ||
97 | } | 100 | } |
98 | 101 | ||
99 | return migrationScript.up(options) | 102 | return migrationScript.up(options) |