The fix was simple: add a new column.
In relational databases, a new column changes the shape of your data. It alters schemas, migrations, queries, indexes, and sometimes application logic. Done right, it enables new features, better performance, and cleaner architecture. Done wrong, it can lock you into bad decisions that are hard to reverse.
When you add a new column in SQL, the process depends on the database engine. In PostgreSQL, you use ALTER TABLE table_name ADD COLUMN column_name data_type;. MySQL and SQLite are similar. The command is fast for empty columns with default values, but for large datasets, physical writes can be expensive. Always plan for the potential cost of the schema migration in production.
Constraints define how the new column behaves. Use NOT NULL only if every row should have a value. Set DEFAULT carefully; backfilling data on large tables can lock writes and slow readers. For indexed columns, measure the impact on both read and write performance. Test queries that will filter or sort by the new column before enabling it in production.