Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Auto swap for foreign key name (#79)

liao文禧9e489d602b81
diff --git a/src/components/EditorSidePanel/RelationshipsTab/RelationshipInfo.jsx b/src/components/EditorSidePanel/RelationshipsTab/RelationshipInfo.jsx
index e273d8a6..f270c2df 100644
--- a/src/components/EditorSidePanel/RelationshipsTab/RelationshipInfo.jsx
+++ b/src/components/EditorSidePanel/RelationshipsTab/RelationshipInfo.jsx
@@ -63,6 +63,9 @@ export default function RelationshipInfo({ data }) {
idx === data.id
? {
...e,
+ name: `${tables[e.startTableId].name}_${
+ tables[e.startTableId].fields[e.startFieldId].name
+ }_fk`,
startTableId: e.endTableId,
startFieldId: e.endFieldId,
endTableId: e.startTableId,