The schema had changed. A new column was needed.
Adding a new column in a production environment is not just a syntax exercise. It can be the difference between a smooth rollout and a failed deployment. The steps are direct, but the wrong order will cost you uptime.
First, confirm why the new column exists. Avoid schema drift. Every field in a relational database carries storage, indexing, and query implications. Map how the column fits into current queries and APIs.
Second, choose the right data type. Precision now prevents costly migrations later. For example, using VARCHAR for numeric data may simplify an insert today but destroy performance in analytic queries tomorrow.
Third, plan the migration path. For large datasets, adding a column with a default value can lock tables. Consider adding the column nullable, then backfilling in batches. Use transactional DDL only if your engine supports it without downtime.