The migration failed at column 37. You stare at the log, see the stack trace, and know exactly what it means: you forgot the new column.
Adding a new column sounds simple, but in production it’s rarely trivial. Schema changes can lock tables, trigger downtime, or break downstream services. If the database is large, even a small change can ripple through the system. A poorly planned ALTER TABLE can stall writes, block queries, and turn a routine deploy into an outage.
The safest path is to make the new column change in stages. First, add the column in a way that doesn’t block reads or writes. In PostgreSQL, you can add a nullable column without a full table rewrite. Next, backfill data in small batches to avoid overwhelming replicas or causing replication lag. Then, update application code to use the new column after the data is ready. Finally, enforce constraints and indexes only when you are certain the migration is stable.