A new column is the smallest structural change that can break production if handled badly. It changes the schema, the queries, the contracts between services. Whether you are adding a nullable integer, a JSONB field, or a foreign key reference, every new column must pass through a precise series of steps to avoid downtime and data loss.
First, define the new column with explicit type and constraints. Never rely on defaults you have not verified across environments. In systems with high traffic, adding a non-null column without a safe default can lock writes for minutes or hours.
Second, deploy schema changes separately from application changes. The database must be ready before code sends data to the new column. Consider backward-compatible approaches: add the new column as nullable, backfill in small batches to avoid table locks, then enforce constraints if needed.
Third, index only after backfill. Adding indexes on large tables with live traffic can cause significant load. Build or rebuild indexes in concurrent mode if your database supports it.