The query finished running, but the data was wrong. A single missing field. The fix was obvious: add a new column.
A new column changes the shape of your table. It adds structure where there was none. In SQL, it means altering the schema. In code, it means modifying the migration file. In production, it means zero downtime if you plan it right.
First, decide the column name and type. Keep it simple, descriptive, and consistent with your existing naming conventions. Use ALTER TABLE in SQL or the migration tools in your chosen framework. For example:
ALTER TABLE orders
ADD COLUMN delivery_eta TIMESTAMP;
If the column needs a default value, set it explicitly. Avoid implicit defaults that depend on environment settings. Then backfill the data in small batches to avoid locking large tables. In systems with heavy traffic, use a rolling deployment or feature flag to avoid breaking code that queries the new field.