Site ↗
Documentation sections
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 Product belongs to Category Product FK field
One-to-many view · 1:N Category displays Products Inverse of an existing Product FK
Many-to-many · N:N Product has Tags Canonical owner and join table

N:1: product and category

  1. Create Product/Category with primary keys; add title to Category.
  2. In Product, Create relation → Many-to-one.
  3. Select Category as Target entity.
  4. Set Field name categoryId and Relation name category.
  5. Set Display field title for readable category labels.
  6. Choose Required or Optional.
  7. Optionally enable Show inverse collection, set products and an Inverse display field from Product.
  8. Finish.

Display field labels Category; Inverse display field labels Product. Configure separately: product forms need category names; category inverse lists need product names.

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. For Category products, select Target entity Product and Owning relation Product.category. Set collection name and label field. No new FK is created.

If no suitable owner exists, the UI reports it. Create Product.categoryId first. A second independent collection cannot replace a missing foreign key.

N:N: products and tags

Select Many-to-many from Product to Tag. Name it tags, set Display field and optionally inverse products. Advanced defines Join table and source/target primary-key names. These are entity keys, not arbitrary join-column names.

There is one owner. Its admin form changes membership; the inverse side only reads. Set Inverse display field for readable labels instead of identifiers.

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.