mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
Adjusted
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const { DataTypes } = require("sequelize");
|
||||
const sequelize = require("../../config/db.config");
|
||||
|
||||
const UnitQuiz = sequelize.define("UnitQuiz", {
|
||||
quiz_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
||||
uuid: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, unique: true },
|
||||
unit_id: { type: DataTypes.BIGINT, allowNull: false, unique: true }, // one quiz per unit
|
||||
title: { type: DataTypes.STRING(255), allowNull: true },
|
||||
is_required: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||
passing_score: { type: DataTypes.INTEGER, defaultValue: 70 }, // percentage
|
||||
max_questions: { type: DataTypes.INTEGER, allowNull: true }, // null = show all
|
||||
createdBy: { type: DataTypes.BIGINT, allowNull: true },
|
||||
updatedBy: { type: DataTypes.BIGINT, allowNull: true },
|
||||
deletedBy: { type: DataTypes.BIGINT, allowNull: true },
|
||||
}, {
|
||||
tableName: "unit_quizzes",
|
||||
timestamps: true,
|
||||
paranoid: true,
|
||||
});
|
||||
|
||||
module.exports = UnitQuiz
|
||||
Reference in New Issue
Block a user