The data model was breaking under the weight of change, and the fix needed to be live before the next deploy. You open the migrations file. You add a new column. Simple, but not trivial. One mistake here and the production tables grind to a halt.
A new column changes schema shape, impacts query plans, and can trigger silent bugs if handled without care. It is more than an extra field—it alters the structure every dependent system relies on. Identify its type, set null constraints, default values, and indexing strategy before it touches the database.
For relational databases, create the column with precision:
ALTER TABLE orders
ADD COLUMN tracking_code VARCHAR(64) NOT NULL DEFAULT '';
This command adds the new column while ensuring defaults prevent null insert errors. If the table is large, consider techniques to avoid locking—create the column as nullable, backfill in batches, then add constraints.