gancio-upstream/server/migrations/20200127101541-event_parent.js

19 lines
430 B
JavaScript

module.exports = {
up: (queryInterface, Sequelize) => {
// return Promise.resolve(1)
return queryInterface.addColumn('events', 'parentId', {
type: Sequelize.INTEGER,
references: {
model: 'events',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
})
},
down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('events', 'parentId')
}
}