The data was there but wrong. The fix started with a new column.
Adding a new column sounds simple. It is not. Schema changes can break APIs, slow queries, and cause deployment risk. The work is not just about writing ALTER TABLE. It is about handling migrations, defaults, indexing, and ensuring uptime.
First, decide if the new column is nullable or needs a default value. A non-null column in a large table can lock writes or cause downtime. For minimal disruption, run an online migration tool or split the change into two steps: add the column as nullable, then backfill data, then enforce constraints.
Second, consider how the new column will be used in queries. If it becomes part of a filter or join condition, create the right index. An index that fits usage patterns prevents slow reads at scale.
Third, align the application logic. Deploy code that can handle both old and new schemas if rolling out changes in stages. This avoids runtime errors when some instances see the old schema.