Relationship attributes

Relationship attributes

This guide explains how relationship attributes work in Ellie and how to use them to define real foreign key constraints on relationships.

Overview

Relationship attributes define which attributes participate in a relationship-based foreign key constraint.

They are mainly used in physical models, where they determine how tables are connected and are used for DDL generation. The same feature can also be enabled for other levels if needed.

Enable the feature

By default, relationship-attribute features are available on the physical level. If you want to use them on other levels, an admin must enable the FK (Relationship FK) field for that level.

  1. Go to Admin Tools → Metadata Settings.

  2. Open the Attribute tab.

  3. Make sure FK (Relationship FK) is enbaled for the level where you want to use relationship attributes.

  4. Optionally enable Draft FK if you want to mark planned foreign-key attributes before defining a real constraint.

Group 31436.png

 

When FK (Relationship FK) is enabled, Ellie unlocks relationship attributes features for that level.

For details about the metadata fields themselves, see Attribute Metadata Settings User Guide.

How to define relationship attributes

There are two common workflows:

  1. While creating a relationship

    You can create a relationship directly between attributes on the canvas. In that case, Ellie tries to determine the relationship direction from the selected attributes, based on PK and Draft FK information.

    If Ellie cannot determine the direction automatically, it creates a one-to-many relationship in the direction you drew the line. If the result is not correct, open Foreign key constraints and adjust it there.

output.gif
Drag-create relationship with relationship attributes
  1. For an existing relationship

    Right-click the relationship line and select Edit foreign key constraints to open the dialog and add or adjust the relationship attributes.

Group 31437.jpg

You can also open it from the relationship editor.

Group 31438.jpg

Using the Foreign key constraints dialog

In the Foreign key constraints dialog:

  • The left side shows the table with the primary key attributes.

  • The right side shows the table with the foreign key attributes.

  • Flip lets you switch the source and target sides if they are not correct.

Select the matching attributes on both sides to define the foreign key constraint. If you select multiple attributes on both sides, Ellie creates a composite foreign key constraint.

For one-to-many relationships, Ellie keeps the defined attributes aligned with the relationship direction: the one side is the source, and the many side is the target. Because of that, using Flip also flips the relationship ends so the directions stay aligned.

image-20260311-112037.png

 

On-canvas behavior

When you hover over a relationship, Ellie highlights the attributes that participate in that relationship. This makes it easier to verify which attributes are used in the constraint.

Group 31439.jpg

 

DDL generation

On the physical level, relationship attributes are used to generate foreign key constraints in DDL / SQL output. If relationship attributes are missing, Ellie can show the relationship visually, but it cannot generate the full foreign key constraint.

Import/export and API

Relationship-attribute data is also supported in Ellie import/export and API workflows. This makes it easier to move relationship-constraint information between Ellie and external systems.