Adding a new column is one of the most common schema changes. Done right, it’s seamless. Done wrong, it locks tables, drops requests, and clogs your deploy pipeline. The difference is in how you plan, execute, and verify the change.
First, define the new column with exact data types and defaults. Pick types that match your future queries, not just the first use case. Avoid ambiguous names. A new_column should never stay called new_column.
Second, decide how to populate it. Adding a column with a default value can trigger a full table rewrite in some databases. In PostgreSQL, using ADD COLUMN ... DEFAULT ... with NOT NULL is dangerous on large tables. Instead, add the column as nullable, backfill in small batches, then set constraints after the data is complete.
Third, deploy in steps. For high-traffic systems, schema changes should be non-blocking. Break the migration into: