Fix add_decom_workflow_type migration to include Remediate in constraint

The older migration drops and re-adds the workflow_type CHECK constraint
but only included FP, Archer, CARD, GRANITE, DECOM. Once Remediate data
exists in the table, re-adding the old constraint fails. Added Remediate
to the constraint set so migrations can run idempotently in order.
This commit is contained in:
Jordan Ramos
2026-06-08 16:20:17 -06:00
parent 3b5dfee235
commit 4d8a6b9c6e

View File

@@ -17,7 +17,7 @@ async function migrate() {
await pool.query(` await pool.query(`
ALTER TABLE ivanti_todo_queue ALTER TABLE ivanti_todo_queue
ADD CONSTRAINT ivanti_todo_queue_workflow_type_check ADD CONSTRAINT ivanti_todo_queue_workflow_type_check
CHECK (workflow_type IN ('FP', 'Archer', 'CARD', 'GRANITE', 'DECOM')) CHECK (workflow_type IN ('FP', 'Archer', 'CARD', 'GRANITE', 'DECOM', 'Remediate'))
`); `);
console.log('✓ Added updated workflow_type constraint (includes DECOM)'); console.log('✓ Added updated workflow_type constraint (includes DECOM)');