Files
gancio/server/api/models/notification.js

27 lines
625 B
JavaScript
Raw Normal View History

2019-12-04 01:20:31 +01:00
2019-06-06 23:54:32 +02:00
module.exports = (sequelize, DataTypes) => {
2019-12-04 01:20:31 +01:00
const Notification = sequelize.define('notification', {
2019-06-06 23:54:32 +02:00
filters: DataTypes.JSON,
email: DataTypes.STRING,
remove_code: DataTypes.STRING,
action: {
type: DataTypes.ENUM,
values: ['Create', 'Update', 'Delete']
},
2019-06-06 23:54:32 +02:00
type: {
type: DataTypes.ENUM,
values: ['mail', 'admin_email', 'ap']
2019-06-06 23:54:32 +02:00
}
}, {
indexes: [{
unique: true,
fields: ['action', 'type']
}]
})
2019-12-04 01:20:31 +01:00
Notification.associate = function (models) {
Notification.belongsToMany(models.event, { through: 'event_notification' })
2019-06-07 17:02:33 +02:00
}
2019-12-04 01:20:31 +01:00
return Notification
2019-06-07 17:02:33 +02:00
}