migration-reviewlisted
Install: claude install-skill prilive-com/go-tdd-pack
# Migration Review
Database migrations are one of the highest-blast-radius changes a repo
ships. Review every migration against these criteria before approval.
Migrations are Tier 1 by default — `go-tdd-feature` or `go-tdd-bugfix`
applies in addition to this review.
## Step 1: Reversibility
- Is there a DOWN migration (or equivalent rollback)?
- Does the DOWN migration actually undo the UP? (Common mistake: UP
adds column X and backfills; DOWN drops column X but the backfilled
data is gone.)
- Is the DOWN migration tested, or at least executed once in a
throwaway environment?
- If rollback would cause data loss, is that called out explicitly?
If there is no safe rollback, the PR description must say so and justify
why forward-only is acceptable for this change.
## Step 2: Zero-downtime
For any database with uptime requirements:
- Is there any `ALTER TABLE` that locks the whole table? On Postgres,
adding a column is fine; adding a `NOT NULL` column without a default
on a large table is not.
- Is the migration compatible with both the currently-deployed
application code AND the new application code?
- Does the deploy plan require: deploy schema change, let it settle,
deploy app change, let it settle, cleanup?
- Are indexes created concurrently (`CREATE INDEX CONCURRENTLY` on
Postgres)?
## Step 3: Concurrent correctness
- Are explicit `LOCK TABLE` statements scoped as tightly as possible?
- Is the migration idempotent? (Re-running should be safe.)
- Doe