The migration script failed. The database needs a new column, and the release clock is ticking.
Adding a new column sounds simple, but it can break production if done carelessly. Schema changes are dangerous. They can lock tables, stall writes, or corrupt data in mid-flight. The risk rises when the app runs in multiple regions or supports high concurrency. You need a plan.
First, define the column as precisely as possible. Choose the right data type. Avoid defaults that cause a full rewrite of the table. In PostgreSQL, adding a nullable column is fast because it doesn’t touch existing rows. In MySQL, behavior changes depending on storage engine and version.
Second, manage backfills. If the new column needs initial data, run the fill in batches. Use indexed filters to avoid scanning the entire table at once. For critical paths, consider backfilling offline using replicas and then swapping in the updated dataset.