The schema had to change. The data model wasn’t broken, but it wasn’t right anymore. A new column would fix it.
Adding a new column sounds trivial until the database is live, under load, and tied to production-critical services. The wrong approach locks tables, stalls queries, and cascades into downtime. The right approach keeps deployments safe, fast, and reversible.
First, define the new column in a migration script. Use explicit types. Avoid nullable unless the design demands it. Default values should be deliberate—not a quick way to bypass constraints. Plan for all downstream consumers: APIs, jobs, reporting tools.
For large tables, run the migration in a non-blocking way. Many relational databases offer ADD COLUMN operations that don’t rewrite the entire table. When defaults need backfilling, do it in batches to prevent spikes in I/O and transaction locks. Test migration performance in a staging environment with the same scale as production.