Adding a new column sounds simple. In practice, it can be dangerous if you don’t control the change. Schema migrations touch live data, indexes, and dependencies in application code. A misstep means downtime or corrupted data.
The safest way to add a new column is to start with a migration plan. In PostgreSQL, use ALTER TABLE ... ADD COLUMN only when you know the default value logic. Adding a column with a non‑null default will rewrite the table, which can lock it for a long time. Instead, add the column as nullable, backfill values in small batches, then update constraints.
For MySQL, watch for table copy behavior in older versions when adding a column in the middle of a table. Add it to the end to avoid full table rebuilds. Use pt-online-schema-change or similar tools for large datasets to keep the system responsive.