fix(pg): drop the runs state check by the name Postgres gave it

This commit is contained in:
sam committed 2026-11-21 17:26:02 +11:00
1 parent 9c0da07807
commit 01fd0fbf97
1 file changed
+4 -4
@@ -4,8 +4,8 @@
-- operator to retry from a step; a workflow.finish step can also leave it
-- waiting for approval or declined. detail explains the ending. Parked and
-- waiting runs are not terminal.
ALTER TABLE runs.runs DROP CONSTRAINT runs_runs_state_check;
ALTER TABLE runs.runs ADD CONSTRAINT runs_runs_state_check
ALTER TABLE runs.runs DROP CONSTRAINT runs_state_check;
ALTER TABLE runs.runs ADD CONSTRAINT runs_state_check
CHECK (state IN ('queued', 'running', 'waiting', 'succeeded', 'failed', 'cancelled',
'parked', 'waiting_approval', 'declined'));
ALTER TABLE runs.runs ADD COLUMN detail text;
@@ -13,6 +13,6 @@ ALTER TABLE runs.runs ADD COLUMN detail text;
-- +goose Down
UPDATE runs.runs SET state = 'failed' WHERE state IN ('parked', 'waiting_approval', 'declined');
ALTER TABLE runs.runs DROP COLUMN detail;
ALTER TABLE runs.runs DROP CONSTRAINT runs_runs_state_check;
ALTER TABLE runs.runs ADD CONSTRAINT runs_runs_state_check
ALTER TABLE runs.runs DROP CONSTRAINT runs_state_check;
ALTER TABLE runs.runs ADD CONSTRAINT runs_state_check
CHECK (state IN ('queued', 'running', 'waiting', 'succeeded', 'failed', 'cancelled'));