Adding a new column sounds trivial, but in production systems it can be risky. The database is live. Queries run nonstop. A careless change can lock tables, block transactions, or cause downtime. To do it right, you have to think about data types, defaults, nullability, and indexing—before you even write the migration script.
In PostgreSQL, adding a new column with a default value can lock the table while it rewrites data. In MySQL, it may trigger a full table copy depending on the engine and version. Each database has its own rules. Always check the documentation for your specific version, then test on a staging environment that mirrors production.
If you need to add a new column quickly and safely, start without a default. Add it as nullable. Backfill data in small batches to avoid long locks. Once the column is populated, enforce constraints and add indexes. This phased approach preserves uptime and reduces risk.