The table was ready, but the schema was not. You needed a new column, and you needed it without downtime.
Adding a new column in production is simple only when you have planned for it. A careless ALTER TABLE can lock writes, block queries, and stall your service. In high-traffic environments, this risk is not acceptable. To create a new column safely, you must understand both the database engine’s behavior and your deployment strategy.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast when a default isn’t set. Adding a NOT NULL column with a default forces a table rewrite, which can block operations. In MySQL, the cost of adding a column depends on the storage engine and version; recent releases with ALGORITHM=INSTANT make it fast, but older setups require a full table copy.