Adding a new column sounds simple. In production, it is not. Schema changes touch code paths, migrations, indexes, and live traffic. The wrong step can lock a table, block writes, or trigger a cascade of errors. The right step makes the change without breaking uptime or performance.
A new column in SQL is defined with ALTER TABLE. The safest migrations split it into stages. First, add the column as nullable. This ensures no mass rewrite of existing rows. Next, backfill in controlled batches to prevent long locks. Then, apply NOT NULL or defaults only after the data is ready.
With Postgres, ALTER TABLE ... ADD COLUMN runs fast for nullable columns without defaults. MySQL follows similar rules but requires care with large tables on older versions. In all cases, wrapping the migration in transactions can avoid half-applied changes, but beware of locking scope.