mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 05:37:53 +00:00
Remove any leftover knex migrations locks before running migrations
Closes #598 Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
parent
a2f0cacf19
commit
c8d79c3b7d
@ -13,7 +13,10 @@ module.exports = class DB
|
|||||||
)
|
)
|
||||||
|
|
||||||
init: =>
|
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)
|
# Returns a knex object for one of the models (tables)
|
||||||
models: (modelName) =>
|
models: (modelName) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user