Adding a new column should be simple, but in production systems, nothing is simple. Schema changes can lock tables, slow queries, and stall deployment pipelines. The wrong migration at the wrong time can bring down a service. The only way forward is to plan for the change, execute it without downtime, and ensure data integrity.
A new column alters the shape of your data. Before you run a migration, decide if the column needs a default value, if it will be nullable, and how it will be indexed. An unindexed new column may slow reads. An over-indexed one can cripple writes. Review entity relationships. Update your ORM mappings or API contracts in sync with the schema change to avoid runtime errors.
For zero-downtime deployments, split the migration into phases. First, add the new column as nullable. Deploy code that can read and write it without relying on it. Backfill existing rows in small batches to avoid overwhelming the database. Once complete, enforce constraints and update application logic to treat the column as required.