create_index
Create a database index on MySQL/MariaDB tables. Includes unique index support, dry-run preview, and reversible undo for rollback.
Instructions
[WRITE][risk=medium] Create an index. Reversible: undo drops the created index.
The created (table, name) is returned so the harness records an undo that
drops exactly this index. Pass dry_run=True to preview. Alternatively pass
definition (a captured CREATE INDEX statement — this is how
drop_index's undo descriptor replays) INSTEAD of table/columns.
Args:
table: Table to index (optionally schema-qualified). Required unless
definition is given.
columns: Column names to index. Required unless definition is given.
name: Index name (auto-generated from table+columns when omitted).
unique: Create a UNIQUE index.
definition: A full CREATE [UNIQUE] INDEX statement to execute verbatim
(shape-validated). Mutually exclusive with table/columns.
dry_run: If True, preview without creating.
target: Target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| table | No | ||
| target | No | ||
| unique | No | ||
| columns | No | ||
| dry_run | No | ||
| definition | No |