The dataset was solid. Only one thing was missing: a new column.
Adding a new column to a production table is simple in theory. In practice, it can break queries, lock writes, and block deployments if done without care. The right approach depends on your database engine, table size, and uptime needs.
In SQL, the starting point is straightforward:
ALTER TABLE orders ADD COLUMN processed_at TIMESTAMP NULL;
This will work on small tables. On large datasets, the command can block reads or cause downtime. Use online schema change tools like gh-ost or pt-online-schema-change for MySQL, or check if your Postgres version supports ALTER TABLE ... ADD COLUMN without a table rewrite.
Consider default values carefully. A non-null column with a default will often rewrite the entire table, increasing lock time. In Postgres, adding a column with a constant default in newer versions avoids the rewrite, but older releases do not.