Pinned because I link it weekly. Before any migration touches production:
- Reversible? If not, write the forward-fix first.
- Lock check: will it take ACCESS EXCLUSIVE on a hot table? If yes, do it in steps or at 3am with a statement timeout.
- Backfill strategy: batched, throttled, resumable. No single UPDATE over millions of rows.
- Dual-read/write period for renames. The old column stays until two deploys later.
- Rollback deploy tested, not just theorized. Actually run the old build against the new schema on staging.
- Backup timestamp noted in the deploy thread. Not "backups exist". The timestamp.
The migrations that hurt us were never exotic. They were ADD COLUMN with a default on a big table at noon. Respect the boring checklist.