A new column can be a minor schema change or a dangerous migration, depending on data size, indexing, and system load. The wrong approach locks rows, blocks writes, or takes the service down. The right approach ships cleanly with zero downtime.
Start with the schema. Decide the column type, nullability, default values, and indexing strategy before writing migration code. For large datasets, avoid adding a default in the same DDL statement as the column creation—most relational databases will rewrite the entire table. Instead, add the column as nullable, backfill incrementally, then enforce constraints.
In PostgreSQL, ALTER TABLE for a new nullable column is fast because it only updates metadata. In MySQL, older versions may lock the table, so online DDL or controlled replicas are safer. Cloud-managed databases can have their own operational quirks, so read the provider’s migration documentation before deploying.