diff --git a/packages/nc-gui/components/erd/RelationEdge.vue b/packages/nc-gui/components/erd/RelationEdge.vue index 8c8bf44529..5cda21a107 100644 --- a/packages/nc-gui/components/erd/RelationEdge.vue +++ b/packages/nc-gui/components/erd/RelationEdge.vue @@ -112,7 +112,7 @@ export default { /> { const source = column.fk_model_id! const target = (column.colOptions as LinkToAnotherRecordType).fk_related_model_id! - let sourceColumnId, targetColumnId, edgeLabel + let sourceColumnId, targetColumnId + let edgeLabel = '' if ((column.colOptions as LinkToAnotherRecordType).type === 'hm') { sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id @@ -110,14 +111,15 @@ const populateEdges = () => { if ((column.colOptions as LinkToAnotherRecordType).type === 'mm') { sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_parent_column_id targetColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id - edgeLabel = - config.showJunctionTableNames && edgeMMTableLabel((column.colOptions as LinkToAnotherRecordType).fk_mm_model_id!) + edgeLabel = config.showJunctionTableNames + ? edgeMMTableLabel((column.colOptions as LinkToAnotherRecordType).fk_mm_model_id!) + : '' } if (source !== target) dagreGraph.setEdge(source, target) return { - id: `e-${sourceColumnId}-${source}-${targetColumnId}-${target}`, + id: `e-${sourceColumnId}-${source}-${targetColumnId}-${target}-#${edgeLabel}`, source: `${source}`, target: `${target}`, sourceHandle: `s-${sourceColumnId}-${source}`,