When a schema changes, velocity dies without precision. Adding a new column is simple to describe but easy to botch. In production systems, it demands control. You must know the migration path, the data type, the default values, and the impact on queries. You must ensure that the new column will not lock the table for longer than your SLA allows.
In SQL, the process starts with ALTER TABLE. In PostgreSQL:
ALTER TABLE orders ADD COLUMN tracking_id TEXT;
This is the low-risk form. But even a small column can trigger a full table rewrite if not handled carefully. Large datasets demand phased rollouts — add the column, backfill in batches, then add constraints or indexes. Avoid adding NOT NULL until the column is populated, or migration times will spike.
In MySQL, adding a new column can be near-instant with ALGORITHM=INPLACE, but not all alterations support it. Check the execution plan before running in production. Always test your migration on staging with production-scale data.