mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 09:02:01 +01:00
29 lines
560 B
JavaScript
29 lines
560 B
JavaScript
|
|
const sequelize = require('./index').sequelize
|
|
const { Model, DataTypes } = require('sequelize')
|
|
|
|
class Notification extends Model {}
|
|
|
|
Notification.init({
|
|
filters: DataTypes.JSON,
|
|
email: DataTypes.STRING,
|
|
remove_code: DataTypes.STRING,
|
|
action: {
|
|
type: DataTypes.ENUM,
|
|
values: ['Create', 'Update', 'Delete']
|
|
},
|
|
type: {
|
|
type: DataTypes.ENUM,
|
|
values: ['mail', 'admin_email', 'ap']
|
|
}
|
|
},
|
|
{
|
|
sequelize,
|
|
modelName: 'notification',
|
|
indexes: [{
|
|
unique: true,
|
|
fields: ['action', 'type']
|
|
}]
|
|
})
|
|
|
|
module.exports = Notification
|