'use strict'; /** * 判断题模型 - JudgeQuestion * * 对应 judge_questions 表,存储所有组别的判断题。 * 通过 group 字段区分中职组(zhongzhi)和高职组(gaozhi)。 */ module.exports = app => { const { STRING, INTEGER, DATE, TEXT } = app.Sequelize; return app.model.define('JudgeQuestion', { id: { type: INTEGER, primaryKey: true, autoIncrement: true, comment: '主键ID', }, group: { type: STRING(20), allowNull: false, comment: '组别:zhongzhi/gaozhi', }, question: { type: TEXT, allowNull: false, comment: '题目内容', }, answer: { type: STRING(10), allowNull: false, comment: '正确答案:true 或 false', }, score: { type: INTEGER, allowNull: false, defaultValue: 5, comment: '分值', }, sort_order: { type: INTEGER, allowNull: false, defaultValue: 0, comment: '排序', }, created_at: { type: DATE, defaultValue: app.Sequelize.NOW, comment: '创建时间', }, updated_at: { type: DATE, defaultValue: app.Sequelize.NOW, comment: '更新时间', }, }, { tableName: 'judge_questions', timestamps: true, createdAt: 'created_at', updatedAt: 'updated_at', }); };