2017-03-27 11:23:00 +00:00
|
|
|
'use strict'
|
2017-03-28 07:25:36 +00:00
|
|
|
const isSQLite = require('../utils').isSQLite
|
2017-03-27 11:23:00 +00:00
|
|
|
module.exports = {
|
|
|
|
up: function (queryInterface, Sequelize) {
|
|
|
|
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
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
down: function (queryInterface, Sequelize) {
|
|
|
|
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
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|