The table was ready, but the new column was missing. The query ran, the code deployed, but the data had nowhere to go. One schema change stood between a backlog of feature work and a clean release.
Adding a new column sounds basic. In production, it is not. Schema migrations can block writes, lock rows, and crash services if executed blindly. The right approach begins with understanding how your database engine handles ALTER TABLE under load. Some engines rewrite the entire table. Others can add a nullable column in constant time. The difference decides whether your users notice downtime.
Plan the migration in steps. First, create the new column with safe defaults. Avoid NOT NULL constraints at creation for large tables; add them later after backfilling. Backfill in batches to prevent locking or flooding replication. Track the rollout with metrics that surface slow queries or replication lag.