The table was ready, but the data had nowhere to go. You need a new column. You need it fast, without breaking schema integrity or locking up production.
Adding a new column is a common change, but the wrong approach can cause downtime, corrupt data, or trigger expensive full-table rewrites. The strategy depends on your database engine, the size of your dataset, and whether you can deploy in a single transaction.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is straightforward for nullable fields with defaults specified at runtime. Avoid setting a default value in the DDL if you are altering large tables; it forces an immediate rewrite. Instead, add the column, backfill in batches, then set NOT NULL once the data is verified.
MySQL behaves differently. In older versions, adding a column could lock the entire table. Modern releases with ALGORITHM=INPLACE or INSTANT make certain column additions metadata-only operations. Always test in staging because even “instant” changes can fail if constraints, data types, or indexes are incompatible.