The fix was simple: add a new column.
A new column is one of the most common database changes. It looks small in code but can create big problems in production if done wrong. Changing tables in place can lock writes, block reads, or cause migrations to take hours. On large datasets, a careless migration means downtime.
Before adding a new column, check your database engine’s specifics. In PostgreSQL, adding a nullable column with no default is fast. Adding it with a default rewrites the whole table. In MySQL, behavior changes between versions, and some operations are online while others require a full table copy. Know the impact before you run the migration.
Use feature flags to decouple schema changes from application code. First, deploy the new column. Then, populate it in the background. Only when it’s ready should your code begin to read and write to it. This reduces risk and keeps production healthy.