mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00

Move 'unique' constraint to another statement (SQLite don't support set unique when addColumn)
19 lines
548 B
JavaScript
19 lines
548 B
JavaScript
'use strict'
|
|
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'])
|
|
})
|
|
}
|
|
}
|