Skip to content

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

fix: plan data (#11238)

Danny Xu05f7eaba3aff
diff --git a/backend/migrator/migration/prod/2.15/0002##pitr.sql b/backend/migrator/migration/prod/2.15/0002##pitr.sql
index 5448b5f56c..9459e25f37 100644
--- a/backend/migrator/migration/prod/2.15/0002##pitr.sql
+++ b/backend/migrator/migration/prod/2.15/0002##pitr.sql
@@ -13,4 +13,5 @@ DELETE FROM stage WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.stage_id
DELETE FROM instance_change_history WHERE issue_id IN (SELECT id FROM issue WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = issue.pipeline_id) AND issue.type = 'bb.issue.database.general');
DELETE FROM instance_change_history WHERE type = 'BRANCH';
DELETE FROM issue WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = issue.pipeline_id) AND issue.type = 'bb.issue.database.general';
+DELETE FROM plan WHERE pipeline_id IN (SELECT id FROM pipeline WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = pipeline.id));
DELETE FROM pipeline WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = pipeline.id);