safe-schema-migrations
Installation
SKILL.md
Safe Schema Migrations
Change the schema without downtime, locks on hot tables, or irreversible steps. Treat the migration and the code deploy as coordinated steps, not one big switch. Pair with financial-invariants for data correctness and scale-readiness-review for sizing impact.
Workflow
1. Classify the change
- Additive (nullable column, new table/index): lowest risk.
- Backfill: risk is runtime and lock duration.
- Constraint/type change (NOT NULL, FK, widen/narrow): risk is table locks and rewrites.
- Rename/move: never in place under a running app — expand/contract instead.
- Destructive (drop): only after no code references it for a full deploy cycle.
2. Expand / contract
Each phase ships independently and is reversible; the app is never broken between steps: