fix #27, fix #25, fix #26, fix #20, fix #19

This commit is contained in:
lesion
2019-03-18 01:42:42 +01:00
parent b93cf91dbd
commit 7111b4578b
31 changed files with 270 additions and 70 deletions

View File

@@ -48,7 +48,15 @@ Event.hasMany(Comment)
Event.belongsToMany(Tag, { through: 'tagEvent' })
Tag.belongsToMany(Event, { through: 'tagEvent' })
const EventNotification = db.define('EventNotification')
const EventNotification = db.define('EventNotification', {
status: {
type: Sequelize.ENUM,
values: ['new', 'sent', 'error'],
defaultValue: 'new',
index: true
}
})
Event.belongsToMany(Notification, { through: EventNotification })
Notification.belongsToMany(Event, { through: EventNotification })