diff --git a/deploy/postgres/goose/00033_2026-09-14-task-run-blocked-pending-governance.sql b/deploy/postgres/goose/00033_2026-09-14-task-run-blocked-pending-governance.sql new file mode 100644 index 00000000..90877f1e --- /dev/null +++ b/deploy/postgres/goose/00033_2026-09-14-task-run-blocked-pending-governance.sql @@ -0,0 +1,37 @@ +-- +goose Up +-- Pre-activation document runs stay 202 but persist blocked_pending_governance +-- without starting a squad or taking a lease. + +ALTER TABLE task_runs DROP CONSTRAINT IF EXISTS chk_task_run_status; + +ALTER TABLE task_runs ADD CONSTRAINT chk_task_run_status CHECK ( + status IN ( + 'pending', + 'running', + 'completed', + 'failed', + 'cancelled', + 'finalizing_failed', + 'quality_failed', + 'interrupted', + 'pending_author_confirmation', + 'blocked_pending_governance' + ) +); + +-- +goose Down +ALTER TABLE task_runs DROP CONSTRAINT IF EXISTS chk_task_run_status; + +ALTER TABLE task_runs ADD CONSTRAINT chk_task_run_status CHECK ( + status IN ( + 'pending', + 'running', + 'completed', + 'failed', + 'cancelled', + 'finalizing_failed', + 'quality_failed', + 'interrupted', + 'pending_author_confirmation' + ) +);