fix: Support SQlite
Move 'unique' constraint to another statement (SQLite don't support set unique when addColumn)
This commit is contained in:
@@ -3,12 +3,17 @@ module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'title', {
|
||||
type: Sequelize.TEXT
|
||||
}).then(function () {
|
||||
// manual added index will be removed in sqlite
|
||||
return queryInterface.addIndex('Notes', ['shortid'])
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'title', {
|
||||
type: Sequelize.STRING
|
||||
}).then(function () {
|
||||
return queryInterface.addIndex('Notes', ['shortid'])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user