The migration failed at midnight because the schema was wrong. The table needed a new column, but no one caught the missing constraint until production was already locked.
Adding a new column sounds simple. It can be. But in production systems with high traffic, even a minor change can cause downtime or data loss. You cannot rely on guesswork. Planning is the difference between a quick deploy and a postmortem.
Start with clarity. Define exactly what the new column will store, its data type, default value, and whether it allows nulls. Decide if the column should be indexed. If it’s a breaking change, plan for backfilling data in controlled stages.
Use migration scripts that are idempotent and reversible. Test them in an environment that matches production as closely as possible. For large datasets, consider adding the column without constraints first, then applying non-blocking updates in small batches. If your database supports it, run the change online to avoid long locks.