add_relation
Creates ONE relation between two entities. The source field has to be of type 'reference'. The cardinality (crow's foot) is specified on each end — by default 'many' on the FK side, 'one' on the target side. Several relations: add_relations_batch places them in 1 call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique ID of the relation | |
| label | No | ||
| onDelete | No | ||
| onUpdate | No | ||
| toCellId | Yes | ID of the target entity | |
| toFieldId | Yes | ID of the target field (typically the PK) | |
| fromCellId | Yes | ID of the source entity (FK side) | |
| fromFieldId | Yes | ID of the FK field (must be of type reference) | |
| cardinalityTo | Yes | Cardinality on the target side | |
| cardinalityFrom | Yes | Cardinality on the source side | |
| expectedProjectId | No | UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted. |