upsert_relationship
Create or update ERD relationships between entities, specifying cardinality, foreign key referential actions, and constraint names.
Instructions
Creates a relationship (no relationshipId, source/targetEntityId required — FKs derived automatically) or updates one (relationshipId given). On update, sourceEnd/targetEnd take precedence; otherwise ends are re-derived from cardinality. onDelete/onUpdate set the FK referential actions ('noAction' reverts to the DB default); constraintName sets the FK constraint name (empty string reverts to auto-generation).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Target ERD — exactly one of a local file ({file}) or a server ERD ({erdId}) | |
| onDelete | No | ||
| onUpdate | No | ||
| sourceEnd | No | ||
| targetEnd | No | ||
| cardinality | No | ||
| constraintName | No | ||
| relationshipId | No | ||
| sourceEntityId | No | ||
| targetEntityId | No | ||
| relationshipType | No |