Adding a new column sounds simple. It isn’t. Schema changes can lock tables, block writes, and stall deployments if done carelessly. In production, that’s downtime you can’t afford. The right approach is deliberate: know the impact, choose the right migration strategy, and keep availability high.
First, understand the scope. Check the row count, indexes, and dependent queries. A new column with a default value can rewrite the entire table on some databases, so measure before you execute.
Second, choose the right command. In PostgreSQL, ALTER TABLE ADD COLUMN is often safe when adding nullable columns without defaults. Setting a default on the same command can trigger a full table rewrite on older versions. In MySQL, large tables may need an online schema change tool like pt-online-schema-change or gh-ost to avoid locking.