change query

This commit is contained in:
2026-07-20 11:28:21 +08:00
parent b401c1b53a
commit a2c9936f79
5 changed files with 49 additions and 53 deletions
@@ -0,0 +1,24 @@
'use strict';
// The order_index/is_required linear sequencing lock (added in
// 20260709000005-add-order-index-and-is-required-to-tasks) is redundant now
// that tasks have an explicit prerequisite graph (task_prerequisites, added
// in 20260717000001-create-task-prerequisites). Locking a task is now purely
// a function of its task_prerequisites rows — a task with none is never
// implicitly locked by its position in the list. order_index is kept as a
// display-order-only column.
module.exports = {
async up(queryInterface) {
await queryInterface.removeColumn('tasks', 'is_required');
},
async down(queryInterface, Sequelize) {
await queryInterface.addColumn('tasks', 'is_required', {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: true,
after: 'order_index',
});
},
};