Skip to content

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

chore: branch reconcile state index (#9838)

Danny Xu541cd741b797
diff --git a/backend/migrator/migration/dev/LATEST.sql b/backend/migrator/migration/dev/LATEST.sql
index 90961a039c..b5784b2e9b 100644
--- a/backend/migrator/migration/dev/LATEST.sql
+++ b/backend/migrator/migration/dev/LATEST.sql
@@ -1272,6 +1272,8 @@ CREATE TABLE branch (
CREATE UNIQUE INDEX idx_branch_unique_project_id_name ON branch(project_id, name);
+CREATE INDEX idx_branch_reconcile_state ON branch(reconcile_state);
+
ALTER SEQUENCE branch_id_seq RESTART WITH 101;
CREATE TRIGGER update_branch_updated_ts
diff --git a/backend/migrator/migration/prod/2.12/0004##branch_reconcile.sql b/backend/migrator/migration/prod/2.12/0004##branch_reconcile.sql
index ddabcb92b6..0f93a681bf 100644
--- a/backend/migrator/migration/prod/2.12/0004##branch_reconcile.sql
+++ b/backend/migrator/migration/prod/2.12/0004##branch_reconcile.sql
@@ -1,6 +1,7 @@
ALTER TABLE branch ADD COLUMN base_schema TEXT NOT NULL DEFAULT '';
ALTER TABLE branch ADD COLUMN head_schema TEXT NOT NULL DEFAULT '';
ALTER TABLE branch ADD COLUMN reconcile_state TEXT NOT NULL DEFAULT '';
+CREATE INDEX idx_branch_reconcile_state ON branch(reconcile_state);
UPDATE branch SET base_schema = convert_from(decode(base->>'schema', 'base64'), 'utf8');
UPDATE branch SET head_schema = convert_from(decode(head->>'schema', 'base64'), 'utf8');
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index fcf74fc18e..158ff08b2c 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -1271,6 +1271,8 @@ CREATE TABLE branch (
CREATE UNIQUE INDEX idx_branch_unique_project_id_name ON branch(project_id, name);
+CREATE INDEX idx_branch_reconcile_state ON branch(reconcile_state);
+
ALTER SEQUENCE branch_id_seq RESTART WITH 101;
CREATE TRIGGER update_branch_updated_ts