codimd/lib/migrations/20150915153700-change-notes-title-to-text.ts

26 lines
737 B
TypeScript
Raw Normal View History

import {isSQLite} from "../utils";
export = {
2017-03-27 19:23:00 +08:00
up: 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'])
}
2017-03-27 19:23:00 +08:00
})
},
down: 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'])
}
2017-03-27 19:23:00 +08:00
})
}
}