The migration halted when the schema failed. A missing new column blocked every deployment.
Adding a new column sounds trivial. In production, it is not. The database must stay online, queries must not lock tables for minutes, and the application must handle the change without downtime. A careless migration can cause service degradation, timeouts, or data loss.
Start with the schema change plan. Choose between additive, backfill, and switch-over patterns. An additive migration adds the new column in a way that avoids blocking. Use ALTER TABLE ... ADD COLUMN with defaults deferred to application logic, not the database engine. This prevents a full-table rewrite, which can freeze large datasets.
Backfilling the new column should be done in small batches. Use a background job to populate values, controlling transaction size to prevent locking. Monitor replication lag if you run read replicas. Ensure the application code can handle null or empty values until backfill completes.