1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/models/UE.js

25 lines
537 B
JavaScript
Raw Normal View History

2020-11-22 16:48:06 +01:00
"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class UE extends Model {
static associate(models) {
UE.hasMany(models.Event);
2021-01-17 11:48:14 +01:00
UE.hasMany(models.Evaluation);
2020-11-22 16:48:06 +01:00
UE.belongsToMany(models.User, {through: "UEUser"});
}
}
UE.init({
name : {
type: DataTypes.STRING,
allowNull: false,
unique: true
}
}, {
sequelize,
modelName: "UE",
});
return UE;
};