The schema was locked, but the product team needed change. A new column had to land in the database by end of day. No downtime. No broken queries. No data loss.
A new column is one of the most common database schema changes. Done wrong, it breaks deployments and halts releases. Done right, it ships cleanly with zero disruption. The process hinges on planning, backward compatibility, and safety checks.
First, define the new column clearly. Decide the name, data type, default value, and constraints. Avoid altering existing columns when possible—adding is safer. Keep the first migration simple: create the column nullable, or with a default that won’t block writes.
Second, deploy in phases. Shipping code that writes to the new column before reading it ensures that production stays stable. Once writes are deployed and data is backfilled or populated, enable reads in application code. This two-step deployment prevents errors when older and newer versions of the code run together.