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 inputs
Synthetic fixtureExpected evidenceDecision
Old writer remains activeNew field can still be missingKeep compatibility
Backfill reports completeConcurrent sample has one nullHold constraint
Writers upgraded and rows verifiedNo nulls in the final checkReview constraint step

Hold the constraint while the old writer can produce a null. Recheck rows and application compatibility after switching writers.

Download the synthetic example as CSV

How to run the check

  1. Identify which application versions read or write the changed columns.
  2. Exercise a concurrent old writer during the backfill. Save the failure and expected recovery.
  3. 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

Follow Schema Migration Bench on Bluesky