backend_adaptive_learning/models/monitoringModels/monitoringModel.js
2024-09-13 20:03:35 +07:00

57 lines
1.1 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,
},
},
{
timestamps: false,
tableName: "monitoring",
}
);
return Monitorings;
};
export default MonitoringModel;