The migration broke at 2 a.m. because the schema was wrong. A new column had been added without a plan.
A new column sounds simple. It is not. The database changes you make shape every query, every join, every cache. Add it fast and you risk deadlocks, slow reads, broken code in hidden corners. Do it right and you deliver new capabilities with zero downtime.
Start with the schema. Know the type, size, default value, and constraints before you touch production. Align naming conventions with existing tables to avoid confusion. Document everything so no one has to guess what this column means.
Migrations must be tested against realistic datasets. Adding a new column to a billion rows is a different beast than adding one to a staging table. Use tools that track change scripts, apply them in order, and rollback cleanly if needed. Monitor query plans before and after, watching for unexpected index changes or full table scans.