migration-rehearsallisted
Install: claude install-skill adnanmokhtar/refract
# migration-rehearsal
A migration that takes 80ms on a dev DB can lock prod for 20 minutes. Rehearse on real data first.
## Premise
Deterministic procedure. Every duration, lock window, and rollback claim must come from a real timed run against a real restored copy. Inputs (dump/snapshot, target DB URL, migration ref) and outputs (timing, lock log, chosen algorithm, schema diff) are cited verbatim. The recommendation block is grounded in the captured numbers, not in folklore about how `ALTER TABLE` "usually" behaves. If the rehearsal DB is empty or undersized, abort and restore a full copy first — synthesized timings are worse than none.
## Halt conditions
- Refuse to report a "duration" without `time` output captured from the actual run.
- Refuse to claim "no locks held" without the lock-observer log for the engine's lane.
- Refuse to certify rollback without a post-rollback schema diff = 0.
- Refuse to report an operation as metadata-only without the engine's own confirmation (the algorithm probe in step 4) — a fast rehearsal is not proof the fast path was taken.
- Halt and ask if the copy is a sample / partial — don't extrapolate from a 10k-row table to a 50M-row prod table.
## When to use
- Before any migration on a populated table where the op is class-2 or class-3 (see `migrations.md`), or where the class is unknown.
- Before any `ALTER COLUMN` type change, `SET NOT NULL` on an existing column, `ADD FOREIGN KEY`, or an index build without the engine's online clau