diff --git a/src/db.coffee b/src/db.coffee index 80b2b1b4..ed6296f6 100644 --- a/src/db.coffee +++ b/src/db.coffee @@ -13,7 +13,10 @@ module.exports = class DB ) init: => - @knex.migrate.latest(directory: path.join(__dirname, 'migrations')) + @knex('knex_migrations_lock').update({ is_locked: 0 }) + .catch(->) # Knex doesn't return a bluebird promise here so we can't catchReturn :( + .then => + @knex.migrate.latest(directory: path.join(__dirname, 'migrations')) # Returns a knex object for one of the models (tables) models: (modelName) =>