mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
units,lesson as standalone
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
// Part 1A — new requirement types (submit_text, pass_quiz) + review workflow.
|
||||
// `prompt` is submit_text's instructions field (mirrors link_label/reference_label
|
||||
// as the type-specific display field). `requires_review` opts any submission-based
|
||||
// requirement into admin approve/reject before it counts as complete.
|
||||
// task_requirements.type has no DB-level CHECK constraint (verified against the
|
||||
// live schema — Sequelize enforces the ENUM only at the application layer for
|
||||
// this table), so no constraint migration is needed to add the new type values.
|
||||
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.addColumn('task_requirements', 'prompt', {
|
||||
type: Sequelize.TEXT,
|
||||
allowNull: true,
|
||||
after: 'reference_label',
|
||||
});
|
||||
await queryInterface.addColumn('task_requirements', 'requires_review', {
|
||||
type: Sequelize.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
after: 'prompt',
|
||||
});
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.removeColumn('task_requirements', 'requires_review');
|
||||
await queryInterface.removeColumn('task_requirements', 'prompt');
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user