LMS/E-Learning-Backend-main/app/models/Practicetests.js
2025-09-01 19:37:35 +05:30

27 lines
955 B
JavaScript

module.exports = (sequelize, type) => {
const Practicetest = sequelize.define('practicetests', {
id: {
type: type.INTEGER,
primaryKey: true,
autoIncrement: true
},
practice_name: {
type: type.STRING,
unique: {
args: true,
msg: 'Oops. Looks like Practice Test already exist.'
}
},
certi_id: type.INTEGER,
course_id: { type: type.STRING, get: function () { return this.getDataValue('course_id').split(',') } },
acronums: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('acronums') ? this.getDataValue('acronums').split(',') : [] } },
time: type.STRING,
type: type.ENUM('LINEAR', 'ADAPTIVE'),
description: type.TEXT,
status: {
type: type.INTEGER,
defaultValue: 0
}
})
return Practicetest;
}