2017-03-27 11:23:00 +00:00
|
|
|
'use strict'
|
2020-04-19 11:31:44 +00:00
|
|
|
function isSQLite (sequelize) {
|
|
|
|
return sequelize.options.dialect === 'sqlite'
|
|
|
|
}
|
|
|
|
|
2017-03-27 11:23:00 +00:00
|
|
|
module.exports = {
|
2020-06-02 11:48:38 +00:00
|
|
|
up: async function (queryInterface, Sequelize) {
|
2017-03-27 11:23:00 +00:00
|
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
|
|
type: Sequelize.TEXT
|
2017-03-28 07:16:09 +00:00
|
|
|
}).then(function () {
|
2017-03-28 07:25:36 +00:00
|
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
|
|
// manual added index will be removed in sqlite
|
|
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
|
|
}
|
2017-03-27 11:23:00 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2020-06-02 11:48:38 +00:00
|
|
|
down: async function (queryInterface, Sequelize) {
|
2017-03-27 11:23:00 +00:00
|
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
|
|
type: Sequelize.STRING
|
2017-03-28 07:16:09 +00:00
|
|
|
}).then(function () {
|
2017-03-28 07:25:36 +00:00
|
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
|
|
// manual added index will be removed in sqlite
|
|
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
|
|
}
|
2017-03-27 11:23:00 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|