review_migration
Checks MySQL DDL and migration scripts for locking, data-loss, and replication risks, then returns a safe/review/block verdict with line-specific fixes.
Instructions
Review MySQL DDL or a migration script for locking, data-loss and replication risks.
Args: sql: The SQL to run, one or more statements separated by semicolons. schema: Optional CREATE TABLE statements for the tables involved (e.g. from SHOW CREATE TABLE). Makes column-type and index checks exact. stats: Optional size per table from information_schema.tables: a row count ({"orders": 25000000}) or {"orders": {"rows": 25000000, "data_bytes": <data_length>, "index_bytes": <index_length>}}. Large = 1M rows or 5 GB. mysql_version: Optional target server version, e.g. "8.0.28", "8.4.3" or "aurora-3.04" (SELECT VERSION()). Older servers copy the table for more column changes. Without it, 8.0.29 or later is assumed. free_disk_gb: Optional free space on the server's data volume, in GB. With byte sizes in stats, a table rebuild that does not fit is blocked. rollback_sql: Optional down migration kept in a separate file (e.g. a golang-migrate .down.sql or Flyway U__ file). Down sections and --rollback lines inside sql are found without it.
Returns a verdict (safe / review / block) and findings with line, impact and fix.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| stats | No | ||
| schema | No | ||
| free_disk_gb | No | ||
| rollback_sql | No | ||
| mysql_version | No |