db-migration
Installation
SKILL.md
DB Migration Skill
Goal
Implement database schema changes safely using migration-first development. All migrations must be reversible and tested before applying to production.
Steps
-
Inspect current schema
- Read current migration files to understand existing schema
- Check: any foreign key constraints that would be affected?
- Check: any indexes on columns being modified?
- Check: any application code relying on the current schema shape?
-
Design the schema change
- Minimal change to achieve the goal
- Consider backward compatibility:
- Adding nullable column: backward compatible ✓
- Adding NOT NULL column without default: breaking ✗
- Renaming column: breaking ✗ (use add → populate → rename → drop strategy)
- Changing column type: potentially breaking — check data conversion