Expand-contract migration.
also: expand-contract · expand and contract · expand/contract · parallel changeChanging a schema in backward-compatible phases: add the new structure, migrate and dual-write, switch reads, then remove the old.
the two-minute refresher
- A direct column rename breaks whichever code version is still running mid-deploy.
- Expand: add the new column, write both, read the old.
- Migrate: backfill, switch reads to the new column, keep writing both.
- Contract: stop writing the old column, then drop it.