The migration failed at midnight because the schema was wrong. The missing piece was a new column.
Adding a new column sounds simple. In production systems, it can break everything if done wrong. A new column can change data shape, query speed, API responses, and internal contracts. It must be handled with precision.
First, decide why this new column exists. Is it storing derived data, a foreign key, or user input? Define its type, nullability, default behavior, and indexing. These choices affect both performance and storage.
Second, plan backwards-compatible changes. Deploying a new column in a live database requires staged rollouts. Add the column before writing to it. Write to it before reading from it. Backfill in small batches to avoid locking tables and freezing queries. Verify each step before advancing.