mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-23 23:51:50 +00:00
e46874d04a
Detect is using SQLite to add index
25 lines
768 B
JavaScript
25 lines
768 B
JavaScript
'use strict'
|
|
const isSQLite = require('../utils').isSQLite
|
|
module.exports = {
|
|
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'])
|
|
}
|
|
})
|
|
},
|
|
|
|
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'])
|
|
}
|
|
})
|
|
}
|
|
}
|