mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
46 lines
1 KiB
JavaScript
46 lines
1 KiB
JavaScript
'use strict'
|
|
|
|
module.exports = {
|
|
up: (queryInterface, Sequelize) => {
|
|
return queryInterface.createTable('event_notifications', {
|
|
status: {
|
|
type: Sequelize.ENUM,
|
|
values: ['new', 'sent', 'error', 'sending'],
|
|
defaultValue: 'new',
|
|
index: true
|
|
},
|
|
createdAt: {
|
|
allowNull: false,
|
|
type: Sequelize.DATE
|
|
},
|
|
updatedAt: {
|
|
allowNull: false,
|
|
type: Sequelize.DATE
|
|
},
|
|
eventId: {
|
|
type: Sequelize.INTEGER,
|
|
primaryKey: true,
|
|
references: {
|
|
model: 'events',
|
|
key: 'id'
|
|
},
|
|
onUpdate: 'CASCADE',
|
|
onDelete: 'CASCADE'
|
|
},
|
|
notificationId: {
|
|
primaryKey: true,
|
|
type: Sequelize.INTEGER,
|
|
references: {
|
|
model: 'notifications',
|
|
key: 'id'
|
|
},
|
|
onUpdate: 'CASCADE',
|
|
onDelete: 'CASCADE'
|
|
}
|
|
})
|
|
},
|
|
|
|
down: (queryInterface, Sequelize) => {
|
|
return queryInterface.dropTable('event_notifications')
|
|
}
|
|
}
|