create_primary_key
Create or replace a table's primary key from specified column codes, supporting single and composite keys. Clears existing PK membership and includes a dry-run option for safe validation.
Instructions
Create (or replace) the primary key of a table from the given column codes. Supports single-column and composite keys, e.g. columns=['order_id','product_id']. Existing PK membership is cleared. Supports dry_run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| name | No | ||
| columns | Yes | ||
| dry_run | No | ||
| model_id | Yes | ||
| table_ref | Yes |