The migration failed at row 43. A missing new column stopped everything cold.
A new column is one of the most common database changes, yet it’s where systems often break under real traffic. Adding a column sounds simple: run ALTER TABLE, deploy, done. In reality, poor execution can lock tables, cause downtime, or corrupt data. The difference between a smooth rollout and an outage is how you design, deploy, and backfill.
When adding a new column, first define exactly what you need: name, type, constraints, default value, and nullability. Each decision affects performance and compatibility with existing queries. Use explicit types and avoid implicit conversions.
Plan the migration. In large databases, adding a column can lock writes. To avoid this, create the new column in a non-blocking way when the database supports it. For MySQL, use ALGORITHM=INPLACE or INSTANT when possible. For PostgreSQL, adding nullable columns without a default is fast, but adding a default to existing rows rewrites the table—consider splitting steps.