Adding a new column is simple in principle. In practice, it can stall deployments, create schema drift, and risk downtime. The right process matters. A slow migration can block writes. A careless ALTER TABLE can lock rows for minutes. You cannot afford that in a live system.
Start by defining the column with the correct type, default, and nullability. If the dataset is large, avoid adding defaults inline—they force table rewrites in most engines. Instead, create the column nullable, deploy, then backfill in controlled batches. After data is in place, set the default and NOT NULL constraints in a second migration. This two-step method keeps operations online.
For PostgreSQL, ALTER TABLE ... ADD COLUMN is fast for nullable, no-default columns. MySQL may copy the table depending on the engine and version. Always check the execution plan to avoid surprises. Wrap migrations in explicit transactions where supported to keep the schema consistent.