fix: Fixed sequelize-cli db:migration cannot stop when occur error
Up and Down method must return a Promise. breaking changes: docker-hackmd cannot initialize, because db:migration will fail
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
queryInterface.addColumn('Users', 'email', Sequelize.TEXT)
|
||||
queryInterface.addColumn('Users', 'password', Sequelize.TEXT)
|
||||
return queryInterface.addColumn('Users', 'email', Sequelize.TEXT).then(function () {
|
||||
return queryInterface.addColumn('Users', 'password', Sequelize.TEXT)
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
queryInterface.removeColumn('Users', 'email')
|
||||
queryInterface.removeColumn('Users', 'password')
|
||||
return queryInterface.removeColumn('Users', 'email').then(function () {
|
||||
return queryInterface.removeColumn('Users', 'password')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user