What problem does it solve?
This Skill codifies safe, repeatable database migration practices to enable schema and data changes without production downtime, accidental destructive operations, or irreversible edits to merged migration files.
Core Features & Use Cases
- Naming & Idempotency: Enforces timestamped migration filenames and idempotent UP/DOWN SQL so migrations can be applied safely multiple times.
- Zero-Downtime Expand-Contract: Prescribes the Expand → Migrate → Transition → Contract pattern for renames and destructive changes to avoid locks and downtime.
- Separation of Concerns & Rollbacks: Requires DDL and DML to be separated into different files, mandates explicit rollback/downgrade implementations, and forbids direct destructive operations on main branches.
- Use Case: Add a nullable column, backfill values in a separate data migration, switch application writes to the new column, then remove the old column during the contract phase.
Quick Start
Use the schema-migration skill to create a timestamped DDL migration that adds a nullable column, write a separate DML backfill, and follow the expand-migrate-transition-contract workflow.