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/evaluation.js

27 lines
661 B
JavaScript

"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class Evaluation extends Model {
static associate(models) {
Evaluation.belongsToMany(models.User, {through: "EvaluationTeacher"});
Evaluation.hasMany(models.Grade);
Evaluation.belongsTo(models.UE);
}
}
Evaluation.init({
name: {
type: DataTypes.STRING,
allowNull: false
},
date: {
type: DataTypes.DATE,
allowNull: false
}
}, {
sequelize,
modelName: "Evaluation",
});
return Evaluation;
};