Skip to content

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

chore: update sql (#11946)

p0nyd8e59fb82795
diff --git a/backend/store/task.go b/backend/store/task.go
index 705f41af99..56570ed066 100644
--- a/backend/store/task.go
+++ b/backend/store/task.go
@@ -425,10 +425,7 @@ func (s *Store) ListTasksToAutoRollout(ctx context.Context, environmentIDs []int
LEFT JOIN stage ON stage.id = task.stage_id
LEFT JOIN pipeline ON pipeline.id = task.pipeline_id
LEFT JOIN issue ON issue.pipeline_id = pipeline.id
- LEFT JOIN LATERAL
- (SELECT 1 AS e FROM task_run WHERE task_run.task_id = task.id LIMIT 1) task_run
- ON TRUE
- WHERE task_run.e IS NULL
+ WHERE NOT EXISTS (SELECT 1 FROM task_run WHERE task_run.task_id = task.id)
AND task.type != 'bb.task.database.data.export'
AND COALESCE((task.payload->>'skipped')::BOOLEAN, FALSE) IS FALSE
AND COALESCE(issue.status, 'OPEN') = 'OPEN'