diff options
Diffstat (limited to 'server/initializers/migrator.js')
-rw-r--r-- | server/initializers/migrator.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/initializers/migrator.js b/server/initializers/migrator.js index e5288b615..233ee2bdd 100644 --- a/server/initializers/migrator.js +++ b/server/initializers/migrator.js | |||
@@ -64,7 +64,7 @@ function getMigrationScripts (callback) { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | function executeMigration (actualVersion, entity, callback) { | 66 | function executeMigration (actualVersion, entity, callback) { |
67 | const versionScript = entity.version | 67 | const versionScript = parseInt(entity.version) |
68 | 68 | ||
69 | // Do not execute old migration scripts | 69 | // Do not execute old migration scripts |
70 | if (versionScript <= actualVersion) return callback(null) | 70 | if (versionScript <= actualVersion) return callback(null) |
@@ -78,7 +78,12 @@ function executeMigration (actualVersion, entity, callback) { | |||
78 | db.sequelize.transaction().asCallback(function (err, t) { | 78 | db.sequelize.transaction().asCallback(function (err, t) { |
79 | if (err) return callback(err) | 79 | if (err) return callback(err) |
80 | 80 | ||
81 | migrationScript.up({ transaction: t }, function (err) { | 81 | const options = { |
82 | transaction: t, | ||
83 | queryInterface: db.sequelize.getQueryInterface(), | ||
84 | Sequelize: db.Sequelize | ||
85 | } | ||
86 | migrationScript.up(options, function (err) { | ||
82 | if (err) { | 87 | if (err) { |
83 | t.rollback() | 88 | t.rollback() |
84 | return callback(err) | 89 | return callback(err) |