Adding a new column is not just schema work. It is a decision with ripple effects through queries, indexes, migrations, and production uptime. Done right, the change is seamless. Done wrong, it can lock tables, stall deployments, or corrupt data integrity.
Before you write a single migration script, define exactly what this column must hold. Set clear data types—INTEGER, VARCHAR, JSONB—based on usage and query patterns. Avoid generic types that will force costly conversions later. Use NOT NULL constraints only when the column will be populated for every row from the start. Otherwise, allow nulls initially to prevent mass update locks.
Plan the migration path from staging to production. For large datasets, prefer online schema changes over blocking alters. Chunk updates in batches. Leverage tools like ALTER TABLE ... ADD COLUMN with default values computed after creation rather than inline. This prevents long write locks and keeps transactions flowing.