update_relation
Modifies one existing relation (the FK link between two entities), found by its id: cardinalityFrom (FK side), cardinalityTo (target side), label, onDelete, onUpdate, and the appearance: animated (true/false/null), color (ColorKey or null), strokeWidth (px or null), waypoints (manual bends, or null for automatic routing). Only the fields provided change; an explicit null clears label, onDelete, onUpdate and the appearance fields. The endpoints (fromCellId/fromFieldId/toCellId/toFieldId) are fixed: to re-point a relation, delete_relation then add_relation. update_field changes the FK column itself. Manual waypoints are absolute canvas points tied to the current geometry: a layout pass (auto_layout_mcd, auto_layout_canvas, or the tidy-up after add_entity without x/y, or after any write that makes an entity overlap another block, such as add_field / add_fields_batch) clears them for every relation. REFUSED with an error, nothing written, on an unknown id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the relation to modify (the id given to add_relation); its endpoints cannot be changed | |
| color | No | Color of the stroke (ColorKey). null = default. | |
| label | No | Label of the relation; null clears it, omitted leaves it as is | |
| animated | No | Enables/disables the animation. null = default of the type. | |
| onDelete | No | ON DELETE action carried by the DDL export; null clears it, omitted leaves it as is | |
| onUpdate | No | ON UPDATE action carried by the DDL export; null clears it, omitted leaves it as is | |
| waypoints | No | Manual bend points (canvas px). null = auto routing. | |
| strokeWidth | No | Thickness in px (≈ 0.5 to 8). null = default. | |
| cardinalityTo | No | New cardinality on the target side | |
| cardinalityFrom | No | New cardinality on the source (FK) 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. |