create_reference
Create foreign-key references between PDM tables with auto-created FK columns, configurable cardinality, and dry-run support.
Instructions
Create a foreign-key reference between two PDM tables (1:N from parent to child). If parent_columns/child_columns are omitted, the parent's primary key is used and FK columns are auto-created in the child (update_key=true, e.g. user 1--N order creates order.user_id). cardinality like '0,n' or '1,1'. Supports dry_run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model_id": "<model_id>",
"parent_table": "<parent_table>",
"child_table": "<child_table>"
},
"name": "create_reference"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| name | No | ||
| comment | No | ||
| dry_run | No | ||
| model_id | Yes | ||
| update_key | No | ||
| cardinality | No | 0,n | |
| child_table | Yes | ||
| parent_table | Yes | ||
| child_columns | No | ||
| parent_columns | No |