The cause was simple: the table was missing a new column.
Adding a new column is a routine task, but in production it can cost you time, cause downtime, or even break data flows if you choose the wrong approach. The goal is to make schema changes without risking availability or integrity.
In SQL, the ALTER TABLE statement creates a new column. For example:
ALTER TABLE orders
ADD COLUMN tracking_number VARCHAR(50);
By default, this will lock the table for the duration of the operation. On large datasets, that means delays and blocked writes. To avoid this, use non-blocking schema migration tools or database-specific features like PostgreSQL’s ADD COLUMN with a default null, then backfill in batches. MySQL offers ALGORITHM=INSTANT on some column additions, reducing downtime to near zero.