Skip to main content

Relationships (foreign keys)

A relationship is a foreign key linking one field to another. EntityFlow draws them as orthogonal edges and keeps them attached as you move tables around.

Creating a relationship​

Hover over a field until a circular port appears on the edge of the card, then drag from that port onto a target field's port — the edge snaps to the nearest one. EntityFlow routes the edge orthogonally and shows cardinality badges at both ends.

Reconnecting & deleting​

  • Reconnect: select the edge and drag a grab handle to a new port.
  • Auto-route an end: double-click a handle to clear its anchor and return that end to automatic routing.
  • Delete: select the edge and press Delete / Backspace, or use the trash icon in the Refs panel.

The Refs panel with a relationship expanded showing cardinality, colour, width and style

Cardinality​

Edit cardinality in the Refs panel with the per-end buttons. The symbols are:

SymbolMeaning
0Optional
1One
+ / *Many

Toggle every cardinality badge at once via View → Show / Hide cardinalities.

Manual routing​

Select an edge to reveal bend handles on its vertical lane. Drag horizontally to bend the edge into the shape you want. Double-click a segment to reset that edge to automatic routing.

:::note Self-loops A field linked to another field on the same table draws as a curved self-loop. :::

Styling an edge​

Style each edge in the Refs panel:

  • Line colour — 8 swatches plus a custom colour
  • Width — S (1.5px), M (2.5px), or L (3.5px)
  • Solid or Dashed
tip

In the Acme Storefront sample, the FK order_items.product_id → products crosses from the Sales & Fulfilment group into Catalog — a good edge to colour and thicken so the cross-group link stands out.