mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
chore: relocate backend into apps/api ahead of monorepo merge
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
// The live enum type backing `type` is named task_requirement_type (not the
|
||||
// Sequelize-default enum_task_requirements_type) — submit_text was added to
|
||||
// it later via ALTER TYPE (20260715000001). Declared here with the full
|
||||
// merged value set.
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('task_requirements', {
|
||||
requirement_id: { type: Sequelize.UUID, defaultValue: Sequelize.UUIDV4, primaryKey: true },
|
||||
task_id: { type: Sequelize.UUID, allowNull: false, references: { model: 'tasks', key: 'task_id' }, onDelete: 'CASCADE' },
|
||||
type: { type: Sequelize.ENUM('visit_link', 'upload_file', 'read_course', 'read_unit', 'read_lesson', 'submit_text'), allowNull: false },
|
||||
link_url: { type: Sequelize.STRING, allowNull: true },
|
||||
link_label: { type: Sequelize.STRING, allowNull: true },
|
||||
allowed_file_types: { type: Sequelize.JSONB, allowNull: true },
|
||||
max_file_count: { type: Sequelize.INTEGER, allowNull: true, defaultValue: 1 },
|
||||
reference_id: { type: Sequelize.UUID, allowNull: true },
|
||||
reference_label: { type: Sequelize.STRING, allowNull: true },
|
||||
prompt: { type: Sequelize.TEXT, allowNull: true },
|
||||
requires_review: { type: Sequelize.BOOLEAN, allowNull: false, defaultValue: false },
|
||||
order: { type: Sequelize.INTEGER, defaultValue: 0 },
|
||||
createdBy: { type: Sequelize.INTEGER, allowNull: true },
|
||||
updatedBy: { type: Sequelize.INTEGER, allowNull: true },
|
||||
deletedBy: { type: Sequelize.INTEGER, allowNull: true },
|
||||
createdAt: { type: Sequelize.DATE, allowNull: false },
|
||||
updatedAt: { type: Sequelize.DATE, allowNull: false },
|
||||
deletedAt: { type: Sequelize.DATE, allowNull: true },
|
||||
});
|
||||
|
||||
await queryInterface.addIndex('task_requirements', ['task_id']);
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.dropTable('task_requirements');
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user