Skip to content
Latchkey

What Is an Expand-Contract Migration?

An expand-contract migration, also called parallel change, splits a schema change into phases that each keep old and new code working together. The expand phase adds new columns or tables without removing anything, application code is updated to use them, data is backfilled, and only then does the contract phase drop the old structures. Each phase is independently deployable and reversible.

Why it matters

Changing a schema and the code that uses it in one deploy forces a risky lockstep release. Expanding first lets old and new code coexist, so deploys and rollbacks stay safe at every step.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →