The database was ready, but the schema wasn’t. You needed a new column.
Adding a new column can be simple or it can bring production to a halt. The difference is in how you plan, deploy, and migrate. Whether you work with PostgreSQL, MySQL, or another relational database, the steps are the same: understand your existing schema, decide on the correct data type, and ensure backward compatibility.
A new column in a live database must be added without locking tables longer than necessary. In PostgreSQL, an ALTER TABLE ADD COLUMN statement runs quickly when you create the column without a default or a NOT NULL constraint. Then you backfill the data in small batches. Finally, you add the constraints once the data is in place. In MySQL, similar care is required to avoid downtime, and online schema change tools like pt-online-schema-change can help.
Indexes matter. A new column that will be queried often should get its index after the data migration, not before. Building indexes on large tables is expensive. Plan it once, test it twice, then run it in production when you know the exact commands and expected timings.