Commit 5fa8bc5a authored by les's avatar les
Browse files

[fix] manage db migrations

parent a743281e
......@@ -193,15 +193,16 @@ async function upgrade (options) {
const umzug = new Umzug({
storage: 'sequelize',
storageOptions: { sequelize: db },
logging: consola.info,
migrations: {
wrap: fun => {
return () => fun(db.queryInterface, Sequelize).catch(() => false)
return () => fun(db.queryInterface, Sequelize).catch(e => { consola.error(e); return false; })
},
path: path.resolve(__dirname, 'migrations')
}
})
const migrations = await umzug.up()
db.close()
await umzug.up()
return await db.close()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment