fix: Add missing migration

This commit is contained in:
BoHong Li 2017-03-27 19:23:00 +08:00
parent b2985085d0
commit 6f14822413
7 changed files with 139 additions and 0 deletions

View file

@ -0,0 +1,30 @@
'use strict'
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.addColumn('Notes', 'shortid', {
type: Sequelize.STRING,
unique: true,
allowNull: false
}).then(function () {
return queryInterface.addColumn('Notes', 'permission', {
type: Sequelize.STRING,
allowNull: false,
defaultValue: 0
})
}).then(function () {
return queryInterface.addColumn('Notes', 'viewcount', {
type: Sequelize.INTEGER
})
})
},
down: function (queryInterface, Sequelize) {
return queryInterface.removeColumn('Notes', 'viewcount')
.then(function () {
return queryInterface.removeColumn('Notes', 'permission')
})
.then(function () {
return queryInterface.removeColumn('Notes', 'shortid')
})
}
}