Adding a new column to a database table seems simple. In production, it is never simple. Schema migrations can lock tables, delay writes, and break code paths if not managed. Each step must balance speed, safety, and clarity.
A new column should start in a migration file. Define the name, type, nullability, and default. Use an additive change when possible to avoid downtime. Never remove or modify existing columns in the same deploy. If the database supports it, add the column without a table rewrite. Postgres allows fast ALTER TABLE ... ADD COLUMN for many types, but large defaults can still block writes.
After the migration, deploy application code that reads the new column but ignores it if empty. This avoids coupling the schema change to feature release. When the column is ready for writes, enable the feature flag, write data, and ensure indexes are in place. Add indexes after backfilling to reduce impact. Monitor read and write latency before and after the change.