migration-guard
Installation
SKILL.md
Migration-Guard: Safe & Reversible Schema Evolution
Prevent catastrophic schema migrations, unrecoverable data loss, and locking deadlocks in relational databases.
The repository's own migration procedure (its AGENTS.md or README) wins over this checklist.
For a broader rollout plan, the user can explicitly invoke migration; do not load it automatically.
4 Golden Migration Rules
- Reversibility:
- Every forward migration (
up.sql) must have a corresponding tested rollback migration (down.sql). - Drizzle and Prisma generate forward migrations only: write the rollback by hand. Prisma can
draft one with
prisma migrate difffrom the new schema to the previous one with--script(see Prisma's "Generating down migrations" guide).
- Every forward migration (