Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: sql to get active stage (#9745)

Danny Xuf4aaac39a939
diff --git a/backend/store/stage.go b/backend/store/stage.go
index 76263afc67..d83ef43534 100644
--- a/backend/store/stage.go
+++ b/backend/store/stage.go
@@ -127,8 +127,8 @@ func (s *Store) ListStageV2(ctx context.Context, pipelineUID int) ([]*StageMessa
) AS latest_task_run ON TRUE
WHERE task.pipeline_id = stage.pipeline_id
AND task.stage_id <= stage.id
- AND (
- COALESCE((task.payload->>'skipped')::BOOLEAN, FALSE) IS FALSE
+ AND NOT (
+ COALESCE((task.payload->>'skipped')::BOOLEAN, FALSE) IS TRUE
OR latest_task_run.status = 'DONE'
)
)