The query runs clean. But the data needs more. You need a new column.
Adding a new column is not just another migration. It changes the shape of your data, and with it, the way your system behaves. Do it wrong, and you break production. Do it right, and you unlock capabilities that were impossible before.
A new column starts with definition. Decide the type: integer, string, timestamp, JSONB. Pick defaults that make sense. Set nullability with care—nullable fields give flexibility but risk incomplete data. Non-null fields enforce discipline.
In SQL, the command is simple:
ALTER TABLE orders ADD COLUMN order_status TEXT NOT NULL DEFAULT 'pending';
But the simplicity hides complexity. Migrations need to be idempotent in staging. Rollback plans must exist. Large tables require attention to lock times—use ADD COLUMN in low-traffic windows or with concurrency-safe patterns.