The query returned in seconds, but the results were wrong. The schema had changed. A new column was the fix.
Adding a new column sounds simple. In production, it can break everything if done without a plan. Schema changes touch queries, indexes, APIs, and downstream pipelines. Migrations can lock tables, slow writes, and stall deployments. The right process avoids downtime and corrupted data.
First, define the new column in your migration script with explicit types and defaults. Avoid null unless the business logic requires it. In many SQL engines, adding a nullable column is fast; adding a non-null column with a default may rewrite the table. Test on real data.
Second, deploy in phases. Add the column with no logic tied to it. Backfill values in batches to avoid pressure on the database. Once complete, update application code to read and write the new column. Then, shift dependent services. This staged rollout reduces risk.