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

32 lines
942 B
JavaScript

module.exports = (sequelize, type) => {
const Liveques = sequelize.define('livequestions', {
id: {
type: type.INTEGER,
primaryKey: true,
autoIncrement: true
},
question: type.TEXT,
description: type.TEXT,
first_choice: type.TEXT,
second_choice: type.TEXT,
third_choice: type.TEXT,
fourth_choice: type.TEXT,
answer: type.STRING,
ref_link: type.STRING,
point: type.INTEGER,
certi_id: type.INTEGER,
d_id: type.INTEGER,
sd_id: type.INTEGER,
topic_id: type.INTEGER,
testIds: {
type: type.TEXT,
allowNull: true,
get: function () { return this.getDataValue('testIds') ? this.getDataValue('testIds').split(',') : [] }
},
status: {
type: type.INTEGER,
defaultValue: 0
}
})
return Liveques;
}