data-migration
Installation
SKILL.md
Data migration
Migrations are the most irreversible thing most engineers do routinely. Code can be rolled back; a dropped column cannot, and a botched backfill can corrupt data in ways no deploy fixes.
Two properties make a migration safe, and both must hold:
- Backwards compatible: the currently deployed code works before and after it runs
- Reversible, or backed up: you can get back, or you have a copy you have tested restoring
If a migration has neither, it needs a maintenance window and a rehearsal.
1. Never combine schema change with data change
Separate migrations, separate deploys: