The fix was simple: add a new column.
A new column seems like a small change, but it can break production if done wrong. In SQL, adding a column locks the table in some databases. In others, it changes data distribution or default value behavior. The right approach depends on your database engine, table size, and uptime requirements.
When creating a new column, decide its data type with care. Avoid defaults you might regret, especially if you expect high write volume. On large tables, adding a column with a default value can rewrite every row and cause downtime. For PostgreSQL, adding a nullable column without a default is instant. Then, backfill values in controlled batches. For MySQL, check if you can make the change online with ALTER TABLE ... ALGORITHM=INPLACE.
Name the new column clearly. Avoid abbreviations that will confuse future queries. Keep naming consistent with existing schema to make joins and indexes predictable.