Skip to content

Commit dbb5c1b

Browse files
authored
fix: composite primary key sql generation in table editor (supabase#40942)
fixes malformed sql syntax where column quotes were incorrectly placed around comma separator closes supabase#40931
1 parent 621eada commit dbb5c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const getAddPrimaryKeySQL = ({
6161
table: string
6262
columns: string[]
6363
}) => {
64-
const primaryKeyColumns = columns.join('","')
64+
const primaryKeyColumns = columns.map((col) => `"${col}"`).join(', ')
6565
return `ALTER TABLE "${schema}"."${table}" ADD PRIMARY KEY (${primaryKeyColumns})`
6666
}
6767

0 commit comments

Comments
 (0)