Adding a new column to a production database should be simple. Too often, it becomes a risk. Schema changes lock tables. Migrations stall requests. The wrong default freezes everything. But with the right steps, you can add a column without downtime and without breaking your app.
First, confirm the column definition. Choose a type that matches the future data, not just the current state. Decide if nulls are allowed. Consider default values, but avoid adding defaults on large tables in a single statement—the database will rewrite every row.
Next, use additive changes. Add the new column without constraints. Then backfill the data in small batches to avoid long locks. Once the column is filled, add indexes or constraints in separate steps. This pattern works for many databases, including PostgreSQL, MySQL, and SQL Server.
In PostgreSQL, for example: