The migration failed. A single missing column broke the release.
Adding a new column should be simple. Too often, it isn’t. In production, you face data integrity, zero-downtime requirements, and the risk of blocking queries. A long-running ALTER TABLE can lock writes and stall traffic. Done wrong, a “new column” can take down a service.
Plan first. Decide the column’s data type, nullability, and default value. In most relational databases, adding a nullable column without a default is fast. Adding with a non-null default can rewrite the whole table and cause downtime. Use online schema change tools or built-in online DDL options where available.
In PostgreSQL, ALTER TABLE … ADD COLUMN is generally instant for nullable columns. In MySQL, use ALGORITHM=INPLACE to avoid table copies where supported. For large datasets, break the change into two steps: first add the column as nullable; then backfill in small batches; finally add constraints. This makes the operation safer under load.