The migration failed halfway through, and the log pointed to one field: a missing new column.
Adding a new column is one of the most common schema changes. Done poorly, it can lock tables, drop indexes, or break deployments. Done well, it’s invisible to users and safe under load.
Modern databases let you add a new column with minimal downtime, but the details matter. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for NULL defaults but slow for non-NULL defaults because it rewrites the whole table. MySQL’s ALTER TABLE supports ALGORITHM=INPLACE for specific changes, but older versions still lock writes.
When planning a schema migration that adds a new column, define defaults in application code whenever possible. This avoids full table rewrites. If backfilling values is required, use batched updates to spread the load and monitor query performance.