2019-06-07 17:02:33 +02:00
|
|
|
'use strict'
|
2019-06-06 23:54:32 +02:00
|
|
|
module.exports = (sequelize, DataTypes) => {
|
|
|
|
|
const notification = sequelize.define('notification', {
|
|
|
|
|
filters: DataTypes.JSON,
|
|
|
|
|
email: DataTypes.STRING,
|
|
|
|
|
remove_code: DataTypes.STRING,
|
|
|
|
|
type: {
|
|
|
|
|
type: DataTypes.ENUM,
|
|
|
|
|
values: ['mail', 'admin_email', 'mastodon']
|
|
|
|
|
}
|
2019-06-07 17:02:33 +02:00
|
|
|
}, {})
|
|
|
|
|
notification.associate = function (models) {
|
2019-06-26 14:44:21 +02:00
|
|
|
notification.belongsToMany(models.event, { through: models.event_notification })
|
2019-06-06 23:54:32 +02:00
|
|
|
// associations can be defined here
|
2019-06-07 17:02:33 +02:00
|
|
|
}
|
|
|
|
|
return notification
|
|
|
|
|
}
|