mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
fix: Support SQlite
Move 'unique' constraint to another statement (SQLite don't support set unique when addColumn)
This commit is contained in:
parent
6f14822413
commit
e26bb0503f
3 changed files with 25 additions and 7 deletions
|
@ -2,12 +2,17 @@
|
|||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.addColumn('Notes', 'alias', {
|
||||
type: Sequelize.STRING,
|
||||
unique: true
|
||||
type: Sequelize.STRING
|
||||
}).then(function () {
|
||||
return queryInterface.addIndex('Notes', ['alias'], {
|
||||
indicesType: 'UNIQUE'
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.removeColumn('Notes', 'alias')
|
||||
return queryInterface.removeColumn('Notes', 'alias').then(function () {
|
||||
return queryInterface.removeIndex('Notes', ['alias'])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue