Adding a new column is simple in theory. In production, it can break queries, slow deployments, and trigger outages. The difference between a clean migration and a rollback mess is planning, execution, and knowing your tools.
Start with clarity. Define why the new column exists and what it will store. Decide on the exact name, type, nullability, and default values. Any uncertainty at this stage can cascade into application-level errors.
Analyze schema dependencies. Search code, views, triggers, and stored procedures for references. Find any ORM models or API responses that need changes. Avoid hidden coupling by mapping out exactly where the new column will be read and written.
Plan the migration path. For large datasets, adding a column can lock tables and block writes. Use online schema change tools or build migrations in chunks. If the new column needs a default value, consider setting it in application logic before adding it directly to the table to avoid long write operations.