2017-03-27 07:23:00 -04:00
|
|
|
'use strict'
|
2017-03-28 03:25:36 -04:00
|
|
|
const isSQLite = require('../utils').isSQLite
|
2017-03-27 07:23:00 -04:00
|
|
|
module.exports = {
|
|
|
|
up: function (queryInterface, Sequelize) {
|
|
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
|
|
type: Sequelize.TEXT
|
2017-03-28 03:16:09 -04:00
|
|
|
}).then(function () {
|
2017-03-28 03:25:36 -04:00
|
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
|
|
// manual added index will be removed in sqlite
|
|
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
|
|
}
|
2017-03-27 07:23:00 -04:00
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
down: function (queryInterface, Sequelize) {
|
|
|
|
return queryInterface.changeColumn('Notes', 'title', {
|
|
|
|
type: Sequelize.STRING
|
2017-03-28 03:16:09 -04:00
|
|
|
}).then(function () {
|
2017-03-28 03:25:36 -04:00
|
|
|
if (isSQLite(queryInterface.sequelize)) {
|
|
|
|
// manual added index will be removed in sqlite
|
|
|
|
return queryInterface.addIndex('Notes', ['shortid'])
|
|
|
|
}
|
2017-03-27 07:23:00 -04:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|