Adding a new column in a production database is never just one step. It changes storage, queries, indexes, and sometimes the entire performance profile. The goal is speed and precision without risking downtime or data loss.
First, choose the right migration approach. In PostgreSQL, ALTER TABLE ... ADD COLUMN is a fast metadata operation for nullable columns or columns with a default of NULL. For large tables, avoid adding columns with non-null defaults in a single pass. That locks writes and can block traffic. Instead, add the column as nullable, backfill in batches, and then apply constraints.
For MySQL, ALTER TABLE can rebuild the table. Check the engine type. InnoDB online DDL can add columns without full table copy in many cases, but not always. Measure before production.
Always run migrations behind a feature flag or code switch. Deploy schema changes first, then the code that depends on them. This keeps the application functional in mixed-schema states. Monitor query plans after deployment. An unused index may become essential when the new column appears in filters or joins.