Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

:bug: fix: wrap column around quotes for creating index sql command (#27499)

Girish Savlesha389feea6c86d
diff --git a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
index 4ac909504bc..d6533a455ba 100644
--- a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
+++ b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
@@ -99,9 +99,9 @@ const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) =
})
const generatedSQL = `
-CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexType} (${selectedColumns.join(
- ', '
- )});
+CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexType} (${selectedColumns
+ .map((column) => `"${column}"`)
+ .join(', ')});
`.trim()
const onSaveIndex = () => {
diff --git a/package-lock.json b/package-lock.json
index 0e0c3ab5cee..df8c62dd365 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17988,6 +17988,11 @@
"source-map": "^0.6.1"
}
},
+ "node_modules/confbox": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz",
+ "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA=="
+ },
"node_modules/config": {
"resolved": "packages/config",
"link": true
@@ -26019,6 +26024,7 @@
},
"node_modules/jsonc-parser": {
"version": "3.2.0",
+ "dev": true,
"license": "MIT"
},
"node_modules/jsonfile": {
@@ -30987,14 +30993,14 @@
"peer": true
},
"node_modules/mlly": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz",
- "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==",
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz",
+ "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==",
"dependencies": {
"acorn": "^8.11.3",
"pathe": "^1.1.2",
- "pkg-types": "^1.0.3",
- "ufo": "^1.3.2"
+ "pkg-types": "^1.1.1",
+ "ufo": "^1.5.3"
}
},
"node_modules/mobx": {
@@ -33246,13 +33252,13 @@
}
},
"node_modules/pkg-types": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz",
- "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz",
+ "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==",
"dependencies": {
- "jsonc-parser": "^3.2.0",
- "mlly": "^1.2.0",
- "pathe": "^1.1.0"
+ "confbox": "^0.1.7",
+ "mlly": "^1.7.0",
+ "pathe": "^1.1.2"
}
},
"node_modules/playwright": {
@@ -40210,9 +40216,9 @@
"license": "MIT"
},
"node_modules/ufo": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz",
- "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ=="
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz",
+ "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw=="
},
"node_modules/uglify-js": {
"version": "3.17.4",