The migration was almost done when the schema failed. One table lacked a new column, and the deployment halted.
Adding a new column sounds trivial. It can be the fastest DDL change you make. Yet the wrong approach during a live rollout can lock tables, stall writes, or drop performance to zero. Production demands precision.
First rule: know your database engine. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward if the column has no default value. Add a non-null default at scale, and you risk a full table rewrite. In MySQL, beware of large tables without ONLINE DDL; the operation can block everything.
Second rule: plan for data backfill. When you add a new column, you choose between initializing it with nulls or staged updates. Default values in large-scale migrations can kill throughput. Insert new rows with default-ready values first, then use batched updates to populate the column for existing records.