gancio-upstream/server/migrations/20190605160024-create-event-tag.js
2019-06-07 17:02:33 +02:00

32 lines
672 B
JavaScript

'use strict'
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('event_tags', {
eventId: {
type: Sequelize.INTEGER,
references: {
model: 'events',
key: 'id'
}
},
tagTag: {
type: Sequelize.STRING,
references: {
model: 'tags',
key: 'tag'
}
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('event_tags')
}
}