From c51cbe9e2aeba51610e4d356690903d3cd5c0751 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 25 Nov 2025 12:00:05 +0530 Subject: [PATCH] fix: check if the type is non-spatial before clearing. --- .../table-[table]/indexes/createIndex.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/indexes/createIndex.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/indexes/createIndex.svelte index 88af9c2571..f706ab7395 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/indexes/createIndex.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/indexes/createIndex.svelte @@ -71,7 +71,8 @@ // spatial type selected -> reset column list to single empty column // and the column already is not spatial type $effect(() => { - if (selectedType === IndexType.Spatial && !columnList.at(0).value) { + const firstColumn = $table.columns.find((col) => col.key === columnList.at(0)?.value); + if (selectedType === IndexType.Spatial && firstColumn && !isSpatialType(firstColumn)) { columnList = [{ value: '', order: null, length: null }]; } });