The migration failed on the third deploy. Logs said “no such column.” The fix was adding a new column, but not just anywhere, and not in a way that would block production traffic.
A new column changes the schema. In most relational databases, this locks the table. If the table holds millions of rows, the lock can stall queries and trigger timeouts. The right approach is a zero-downtime migration: create the column without breaking existing reads and writes, backfill data in controlled batches, then switch application code to use it.
In PostgreSQL, you can add a nullable column instantly since it doesn’t rewrite the table. But adding a column with a default value before version 11 rewrites the table in full. MySQL’s behavior depends on the storage engine; InnoDB will often rewrite data unless you use ALGORITHM=INPLACE. Knowing these details means you can run ALTER TABLE safely without bringing down your service.