Schema Migration Bench
Schema Migration Checklist for Old and New Clients
Rehearse the old writer and new reader together. Keep the compatibility window open until the backfill, concurrent writes and rollback conditions all pass.
Worked example
| Synthetic fixture | Expected evidence | Decision |
|---|---|---|
| Old writer remains active | New field can still be missing | Keep compatibility |
| Backfill reports complete | Concurrent sample has one null | Hold constraint |
| Writers upgraded and rows verified | No nulls in the final check | Review constraint step |
Hold the constraint while the old writer can produce a null. Recheck rows and application compatibility after switching writers.
How to run the check
- Identify which application versions read or write the changed columns.
- Exercise a concurrent old writer during the backfill. Save the failure and expected recovery.
- Validate the final row conditions and rehearse rollback before enforcing the new constraint.
Check lock behavior and constraint semantics for your database engine and version. Use this fixture away from production.
Does a successful backfill prove the constraint is safe?
Check whether an older writer can still create a missing value, and validate the constraint step separately.
Reference: PostgreSQL ALTER TABLE reference