The migration froze halfway. A missing new column in the database had broken the build, and the queue was already backing up.
Adding a new column sounds simple—until it isn’t. Schema changes in production demand precision. A new column can introduce downtime, block writes, or trigger silent data loss if deployed without a plan. In distributed systems, the fallout spreads fast.
The safest path starts with explicit design. Define the new column clearly: name, type, constraints, and defaults. Determine whether it should be nullable, if it requires an index, and how it interacts with existing queries. Avoid unnecessary defaults; they can cause full table rewrites on large datasets.
Next, decouple schema changes from code changes. Ship the new column in one deployment, update your application to use it in the next. This minimizes race conditions and backward-compatibility risks. If you must backfill data, batch the process to avoid locking and performance degradation.