From 2aee61530df98bdd4ecd022c4855e3045c48d6cd Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 30 Jun 2025 13:06:18 -0230 Subject: [PATCH] Chore/fix index delete (#36774) pass schema to delete index --- .../studio/components/interfaces/Database/Indexes/Indexes.tsx | 1 + apps/studio/data/database-indexes/index-delete-mutation.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx index 3eee09b8556..263d20bfd4d 100644 --- a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx +++ b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx @@ -77,6 +77,7 @@ const Indexes = () => { projectRef: project.ref, connectionString: project.connectionString, name: index.name, + schema: selectedSchema, }) } diff --git a/apps/studio/data/database-indexes/index-delete-mutation.ts b/apps/studio/data/database-indexes/index-delete-mutation.ts index 13bd3e835da..47dea94fe6d 100644 --- a/apps/studio/data/database-indexes/index-delete-mutation.ts +++ b/apps/studio/data/database-indexes/index-delete-mutation.ts @@ -9,14 +9,16 @@ export type DatabaseIndexDeleteVariables = { projectRef: string connectionString?: string | null name: string + schema: string } export async function deleteDatabaseIndex({ projectRef, connectionString, name, + schema, }: DatabaseIndexDeleteVariables) { - const sql = `drop index if exists "${name}"` + const sql = `drop index if exists "${schema}"."${name}"` const { result } = await executeSql({ projectRef,