Adding a new column sounds simple. It isn’t. The wrong migration at the wrong time can stall deployments, lock tables, or corrupt data. In production systems with millions of rows, a careless ALTER TABLE can burn hours of downtime or trigger costly rollbacks.
A new column changes the shape of your data forever. Plan it like a release. First, define the column name, data type, constraints, and defaults. Keep it explicit—avoid nulls unless absolutely necessary. Use a migration script that can run without blocking queries for too long. On large datasets, break the change into phases: add the column without constraints, backfill data in small batches, then enforce constraints in a follow-up migration.
Always test against real data size, not just fixtures. Replica databases let you measure migration time and impact before hitting production. Watch for indexes, triggers, and foreign keys that might multiply the cost of your schema change. Even adding a nullable column can inflate storage or break legacy queries if they implicitly select *.