The team was ready. But the table was locked against the future, and the only way forward was a new column.
Adding a new column is one of the most frequent schema changes in software. It sounds simple. It is not. A poorly executed migration can bring down production, lock tables for minutes or hours, and block writes during high-traffic windows. The work must be exact—both in planning and execution.
In SQL databases, adding a new column requires understanding how your database engine handles schema changes. In Postgres, ALTER TABLE ADD COLUMN is usually fast if you define a column with a default value of NULL. Adding a column with a non-null default forces a full table rewrite, which can be disastrous at scale. In MySQL, ALTER TABLE often copies the entire table unless you use ALGORITHM=INPLACE with supported storage engines and column types.
Zero-downtime deployments demand careful sequencing. Deploy the schema change first with a null default. Update the application code to write and read from the new column. Backfill data in small batches to avoid locking. Only when all rows are populated do you enforce constraints or defaults.