The fix was clear: add a new column.
A new column is one of the most common schema changes in any relational database. It sounds simple, but in production systems it can trigger cascading effects. When you add a new column, you are expanding the table’s shape. This affects queries, indexes, constraints, migrations, and sometimes downstream services.
Before adding a new column, decide its type. INT, VARCHAR, TEXT, JSON, or a domain-specific type. Choose nullability with care—NOT NULL columns require defaults or backfills. For high-traffic tables, adding a new column without locking writes demands online migrations or phased rollouts.
Run the migration in a controlled way. In PostgreSQL and MySQL, adding a nullable column without a default is usually fast. Adding one with a default value in older versions can rewrite the whole table. For large datasets, use tools like pt-online-schema-change, gh-ost, or native online DDL features to prevent downtime.