From 01fd0fbf97f4227bd403a3274122d88d734e91ce Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 21 Nov 2026 17:26:02 +1100 Subject: [PATCH] fix(pg): drop the runs state check by the name Postgres gave it --- internal/platform/pg/migrations/00044_runs_endings.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/platform/pg/migrations/00044_runs_endings.sql b/internal/platform/pg/migrations/00044_runs_endings.sql index 8cc596664..5a8059ef9 100644 --- a/internal/platform/pg/migrations/00044_runs_endings.sql +++ b/internal/platform/pg/migrations/00044_runs_endings.sql @@ -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'));