Adding a new column sounds simple. In production systems, it is not. Schema changes ripple through APIs, migrations, queries, and tests. One wrong step can lock tables, block writes, or corrupt data. Speed matters, but so does precision.
First, define the new column with the right type and constraints. Consider nullability and defaults. Explicit defaults ensure existing rows remain valid. Avoid adding non-null columns without defaults unless downtime is acceptable.
Next, plan the migration. In large datasets, an ALTER TABLE can stall traffic. Use phased migrations—create the column, backfill in batches, then apply constraints. This keeps service online while data transitions. Account for indexes early; adding them after population can save hours of load time.