Adding a new column is simple in theory. In production, it can break everything. Migrations stall. Locks pile up. Queries timeout. The wrong approach at scale means user impact and urgent rollbacks. The right approach keeps the release invisible and safe.
First, define the column in your migration script. Avoid default values that force a table rewrite. If you must backfill data, do it in small batches to prevent locking large rows. Use NULL defaults or computed values where possible. Run the migration in a transaction only if your database engine can handle it without locking the full table.
For PostgreSQL, ADD COLUMN with a NULL default is fast. Adding a column with a constant default rewrites the entire table, which is costly on large datasets. Instead, add it nullable, backfill asynchronously with an indexed query, then alter the column to set the default if needed.