Adding a new column should be simple, but in production systems it carries risk. Schema changes can lock tables, block writes, and cascade into outages. The safest approach is to design the migration to be backward-compatible and reversible.
When adding a new column in SQL, always start with an explicit plan. Define the column name, type, default value, and nullability. Decide if the column will be part of an index or constraint. Avoid adding non-null columns with defaults on massive tables in a single step; it can trigger a full table rewrite. Instead, add the column as nullable first, backfill in batches, then enforce constraints.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable columns without defaults. For MySQL, adding a column requires careful scheduling since it may lock the table depending on the storage engine and version. Use tools like gh-ost or pt-online-schema-change for online schema changes.
If you are iterating on APIs or services that consume the database, ensure that code is deployed to handle the new column before making it required. This eliminates race conditions and deployment rollbacks.