mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-30 19:41:15 -05:00
7b9f9a487b
Signed-off-by: David Mehren <git@herrmehren.de>
28 lines
817 B
JavaScript
28 lines
817 B
JavaScript
'use strict'
|
|
function isSQLite (sequelize) {
|
|
return sequelize.options.dialect === 'sqlite'
|
|
}
|
|
|
|
module.exports = {
|
|
up: async function (queryInterface, Sequelize) {
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
type: Sequelize.TEXT
|
|
}).then(function () {
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
// manual added index will be removed in sqlite
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
}
|
|
})
|
|
},
|
|
|
|
down: async function (queryInterface, Sequelize) {
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
type: Sequelize.STRING
|
|
}).then(function () {
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
// manual added index will be removed in sqlite
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
}
|
|
})
|
|
}
|
|
}
|