aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrator.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-02-16 19:19:56 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-02-16 19:19:56 +0100
commit4793c343fd3cde3c6282ed0fb38e039b4276de0e (patch)
tree566856a8d0bee0ee06e60c5e3bf6b998135a078a /server/initializers/migrator.js
parent3266ad7cf8ff10d0fdae456196eff1653cc7ac21 (diff)
downloadPeerTube-4793c343fd3cde3c6282ed0fb38e039b4276de0e.tar.gz
PeerTube-4793c343fd3cde3c6282ed0fb38e039b4276de0e.tar.zst
PeerTube-4793c343fd3cde3c6282ed0fb38e039b4276de0e.zip
Add email to pods
Diffstat (limited to 'server/initializers/migrator.js')
-rw-r--r--server/initializers/migrator.js9
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
66function executeMigration (actualVersion, entity, callback) { 66function 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)