Adding a new column is simple in theory. In production, it can break queries, slow writes, and trigger downtime you can’t afford. The way you handle it decides if the release is invisible or catastrophic.
A new column in SQL must define its type, constraints, and defaults with precision. Avoid adding it with a non-null default on a large table without a plan. That will lock rows for too long. Use nullable columns first, backfill in small batches, then enforce constraints.
In PostgreSQL, ALTER TABLE table_name ADD COLUMN new_column_name data_type; is the basic form. But wrap it in a transactional migration if possible. In MySQL, watch for table rebuilds when adding a column to the middle of the schema; adding it to the end can be faster.
If the new column is part of a feature flag rollout, deploy the schema before the application logic. The code should handle null data gracefully until the backfill completes. Always measure the impact in staging with production-sized datasets.