clean unused places/tags #107 and unused fields

This commit is contained in:
les
2021-04-09 23:54:17 +02:00
parent 24170f0dfa
commit 5ac73caeac
11 changed files with 86 additions and 46 deletions

View File

@@ -51,6 +51,7 @@ Event.belongsTo(User)
User.hasMany(Event)
Event.belongsToMany(Tag, { through: 'event_tags' })
Tag.belongsToMany(Event, { through: 'event_tags' })
Event.belongsToMany(Notification, { through: EventNotification })
Notification.belongsToMany(Event, { through: EventNotification })

View File

@@ -1,7 +1,6 @@
const { Model, DataTypes } = require('sequelize')
const sequelize = require('./index')
// const Event = require('./event')
class Place extends Model {}
Place.init({
@@ -11,14 +10,7 @@ Place.init({
index: true,
allowNull: false
},
address: DataTypes.STRING,
confirmed: {
type: DataTypes.BOOLEAN,
defaultValue: true,
allowNull: false
}
address: DataTypes.STRING
}, { sequelize, modelName: 'place' })
// Place.hasMany(Event)
module.exports = Place

View File

@@ -1,5 +1,4 @@
const { Model, DataTypes } = require('sequelize')
// const Event = require('./event')
const sequelize = require('./index')
class Tag extends Model {}
@@ -10,19 +9,7 @@ Tag.init({
allowNull: false,
index: true,
primaryKey: true
},
weigth: {
type: DataTypes.INTEGER,
defaultValue: 0,
allowNull: false
},
confirmed: {
type: DataTypes.BOOLEAN,
defaultValue: true,
allowNull: false
}
}, { sequelize, modelName: 'tag' })
// Tag.belongsToMany(Event, { through: 'event_tags' })
module.exports = Tag