UI interface · 0.8.1

Content / Relationships: configuration and editing

Choose N:1, 1:N or N:N, record labels and foreign-key policies.

On this page

Choosing direction

Open an entity in Content. Start through Relation settings → Create relation or Add field → Relation. Select a relationship type, then Basic settings and Advanced settings. Tab changes preserve input.

Type Example Storage
Many-to-one · N:1 ENTITY_NAME belongs to RELATED_ENTITY_NAME ENTITY_NAME FK field
One-to-many view · 1:N RELATED_ENTITY_NAME displays ENTITY_NAME Inverse of an existing ENTITY_NAME FK
Many-to-many · N:N ENTITY_NAME relates to RELATED_ENTITY_NAME Canonical owner and join table

  1. Create ENTITY_NAME and RELATED_ENTITY_NAME with primary keys. Select a target label field, such as title.
  2. In ENTITY_NAME, open Create relation → Many-to-one.
  3. Select RELATED_ENTITY_NAME in Target entity.
  4. Enter the foreign-key field name as Field name (FIELD_NAME) and the separate logical relationship name as Relation name (RELATION_NAME). Replace these placeholders with valid names for your model.
  5. Select a readable target field, such as title, in Display field.
  6. Choose Required or Optional.
  7. Optionally enable Show inverse collection, set its name to INVERSE_COLLECTION_NAME and choose an Inverse display field from ENTITY_NAME.
  8. Click Finish.

Display field labels a RELATED_ENTITY_NAME record; Inverse display field labels an ENTITY_NAME record. The logical relationship name RELATION_NAME, foreign-key field FIELD_NAME and database table name are different settings.

Database constraints

Advanced configures Enforce foreign key and On delete / On update behavior for target records.

Value Meaning
On delete: Restrict Reject deletion while referenced
On delete: Set null Clear optional references; unavailable for Required
On update: Restrict / Cascade Reference behavior when target key changes

1:N: inverse collection

One-to-many view uses an existing relationship in the opposite direction. To show related ENTITY_NAME records inside RELATED_ENTITY_NAME, select Target entity → ENTITY_NAME, Owning relation → ENTITY_NAME.RELATION_NAME, then set INVERSE_COLLECTION_NAME and a label field.

This is an inverse view of the existing ENTITY_NAME.FIELD_NAME reference. It creates neither a new FK nor a new table. Create the N:1 relationship first if no owner exists; an independent collection cannot replace a missing reference.

N:N: a collection of related records

In ENTITY_NAME, choose Many-to-many with target RELATED_ENTITY_NAME. Set the logical collection name COLLECTION_NAME and Display field. For an inverse view, set INVERSE_COLLECTION_NAME and Inverse display field.

Under Advanced → Join table, enter the SQL join-table name JOIN_TABLE_NAME. Source field and Target field are the entities' own primary keys, such as id, not arbitrary join-table column names. COLLECTION_NAME identifies the model/API relationship; JOIN_TABLE_NAME identifies its PostgreSQL storage.

There is one owner: its form changes collection membership. The inverse view stays read-only.

Editing and deletion

Click a Relations tag. N:1 opens the owning-field editor; a collection opens its own editor. Inverse views link to owners. Existing inverse-collection forms fill name/label. Disabling inverse and Finish removes that view from the model.

Delete requires separate confirmation without saving other edits. Resolve projection/model dependencies first. Finish, then Generate to inspect database/API changes.

See CLI relationships.

Settings in the entity header

The selected entity has one header with Relation settings and Entity settings icons on the right. The first opens the persistent entity relationship overview; the second opens entity settings. Declared relationships remain clickable badges below the main information, opening their configuration or an inverse relationship owner. Virtual related data is selected through its fields rather than by creating physical relationships.