backend_adaptive_learning/models/usersModels/reportModel.js
2024-11-06 13:05:04 +07:00

49 lines
934 B
JavaScript

import db from "../../database/db.js";
const ReportModel = (DataTypes) => {
const Reports = db.define(
"report",
{
ID_REPORT: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
validate: {
notEmpty: true,
},
},
ID: {
type: DataTypes.UUID,
allowNull: false,
validate: {
notEmpty: true,
},
references: {
model: "users",
key: "ID",
},
},
REPORTS: {
type: DataTypes.TEXT,
allowNull: false,
validate: {
notEmpty: true,
},
},
TIME_REPORT: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: DataTypes.NOW,
},
},
{
timestamps: false,
tableName: "report",
}
);
return Reports;
};
export default ReportModel;