The migration script failed five minutes before deployment because someone forgot to add a new column. It happens more often than anyone admits, and it can cost hours when the fix should take seconds.
Adding a new column in a production database is not just ALTER TABLE and done. The details define whether your code keeps serving requests or halts under lock. You need to know how the new column interacts with indexes, default values, foreign keys, and live traffic.
Start with the schema change strategy. For small tables, a direct ALTER TABLE ... ADD COLUMN might suffice. For large tables in high-traffic environments, use an online migration tool like gh-ost or pt-online-schema-change to avoid blocking writes. Always benchmark a migration in a staging environment with production-scale data.
Set a default only if necessary. Defaults on large datasets can force a rewrite of every row; this can slow migrations to a crawl. If you just need the column to exist, create it as nullable, backfill in batches, then alter it to set the default or NOT NULL constraint.