Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update pk index name (#8811)

boojack1eedc053f4f8
diff --git a/frontend/src/components/SchemaEditorV1/utils/metadata.ts b/frontend/src/components/SchemaEditorV1/utils/metadata.ts
index 98665a08ae..4808515ecd 100644
--- a/frontend/src/components/SchemaEditorV1/utils/metadata.ts
+++ b/frontend/src/components/SchemaEditorV1/utils/metadata.ts
@@ -110,7 +110,8 @@ export const mergeSchemaEditToMetadata = (
const primaryIndex =
table.indexes.find((index) => index.primary) ||
IndexMetadata.fromPartial({
- name: tableEdit.primaryKey.name,
+ // TODO: Maybe we should let user to specify the index name.
+ name: tableEdit.primaryKey.name || `pk_${tableEdit.name}`,
primary: true,
expressions: [],
});
@@ -302,7 +303,8 @@ export const transformTableEditToMetadata = (
if (tableEdit.primaryKey.columnIdList.length > 0) {
const primaryIndex = IndexMetadata.fromPartial({
- name: tableEdit.primaryKey.name || `${tableEdit.name}_pkey`,
+ // TODO: Maybe we should let user to specify the index name.
+ name: tableEdit.primaryKey.name || `pk_${tableEdit.name}`,
primary: true,
expressions: [],
});