backend_adaptive_learning/models/monitoringModels/monitoringModel.js
2024-09-25 10:57:47 +07:00

62 lines
1.3 KiB
JavaScript

import db from "../../database/db.js";
const MonitoringModel = (DataTypes) => {
const Monitorings = db.define(
"monitoring",
{
ID_MONITORING: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
validate: {
notEmpty: true,
},
},
ID_STUDENT_LEARNING: {
type: DataTypes.UUID,
allowNull: false,
validate: {
notEmpty: true,
},
references: {
model: "student_learning",
key: "ID_STUDENT_LEARNING",
},
},
ID_CLASS: {
type: DataTypes.UUID,
allowNull: true,
references: {
model: "class",
key: "ID_CLASS",
},
},
ID_GURU: {
type: DataTypes.UUID,
allowNull: true,
references: {
model: "teacher",
key: "ID_GURU",
},
},
FEEDBACK_GURU: {
type: DataTypes.STRING(200),
allowNull: true,
},
TIME_MONITORING: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: DataTypes.NOW,
},
},
{
timestamps: false,
tableName: "monitoring",
}
);
return Monitorings;
};
export default MonitoringModel;