@@ -34,9 +34,6 @@ const Notification = db.define('notification', {
|
||||
}
|
||||
})
|
||||
|
||||
Notification.findOrCreate({ where: { type: 'mastodon', filters: { is_visible: true } } })
|
||||
Notification.findOrCreate({ where: { type: 'admin_email', filters: { is_visible: false } } })
|
||||
|
||||
const Place = db.define('place', {
|
||||
name: { type: Sequelize.STRING, unique: true, index: true },
|
||||
address: { type: Sequelize.STRING }
|
||||
@@ -66,4 +63,10 @@ Event.belongsTo(Place)
|
||||
User.hasMany(Event)
|
||||
Place.hasMany(Event)
|
||||
|
||||
async function init () {
|
||||
await Notification.findOrCreate({ where: { type: 'mastodon', filters: { is_visible: true } } })
|
||||
await Notification.findOrCreate({ where: { type: 'admin_email', filters: { is_visible: false } } })
|
||||
}
|
||||
|
||||
init()
|
||||
module.exports = { Event, Comment, Tag, Place, Notification, EventNotification }
|
||||
|
||||
@@ -11,6 +11,7 @@ const User = db.define('user', {
|
||||
},
|
||||
description: Sequelize.TEXT,
|
||||
password: Sequelize.STRING,
|
||||
recover_code: Sequelize.STRING,
|
||||
is_admin: Sequelize.BOOLEAN,
|
||||
is_active: Sequelize.BOOLEAN,
|
||||
mastodon_auth: Sequelize.JSON
|
||||
|
||||
Reference in New Issue
Block a user