[fix] manage db migrations
This commit is contained in:
@@ -193,15 +193,16 @@ async function upgrade (options) {
|
|||||||
const umzug = new Umzug({
|
const umzug = new Umzug({
|
||||||
storage: 'sequelize',
|
storage: 'sequelize',
|
||||||
storageOptions: { sequelize: db },
|
storageOptions: { sequelize: db },
|
||||||
|
logging: consola.info,
|
||||||
migrations: {
|
migrations: {
|
||||||
wrap: fun => {
|
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')
|
path: path.resolve(__dirname, 'migrations')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const migrations = await umzug.up()
|
await umzug.up()
|
||||||
db.close()
|
return await db.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user