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
- Create Product/Category with primary keys; add
titleto Category. - In Product, Create relation → Many-to-one.
- Select Category as Target entity.
- Set Field name
categoryIdand Relation namecategory. - Set Display field
titlefor readable category labels. - Choose Required or Optional.
- Optionally enable Show inverse collection, set
productsand an Inverse display field from Product. - 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.