Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(walk-through): check if exists for drop index for pg (#13719)
rebelice40188839f226
diff --git a/backend/plugin/advisor/catalog/test/pg_walk_through.yaml b/backend/plugin/advisor/catalog/test/pg_walk_through.yamlindex c421565efa..c761eb0959 100644--- a/backend/plugin/advisor/catalog/test/pg_walk_through.yaml+++ b/backend/plugin/advisor/catalog/test/pg_walk_through.yaml@@ -49,6 +49,7 @@CREATE TABLE public.t(a int, "B" int);CREATE INDEX ON t(a, "B");CREATE UNIQUE INDEX ON t(a, "B");+ DROP INDEX IF EXISTS t_a_B_idx_11111;ignore_case_sensitive: falsewant: |-{diff --git a/backend/plugin/advisor/catalog/walk_through_for_pg.go b/backend/plugin/advisor/catalog/walk_through_for_pg.goindex 9e184cc1e4..fcadc827b3 100644--- a/backend/plugin/advisor/catalog/walk_through_for_pg.go+++ b/backend/plugin/advisor/catalog/walk_through_for_pg.go@@ -92,6 +92,9 @@ func (d *DatabaseState) pgDropIndex(indexDef *ast.IndexDef, ifExists bool, _ asttable, index, err := schema.getIndex(indexDef.Name)if err != nil {+ if ifExists {+ return nil+ }return err}