The fix was smaller than a line of code. A new column.
Adding a new column is one of the most common operations in database management. Done right, it improves performance, supports new features, and keeps data structure clear. Done wrong, it can lock tables, stall deployments, and disrupt live traffic.
Before adding a new column, analyze your schema. Understand how the existing fields are used in reads and writes. Check primary keys, indexes, and constraints. Determine whether the new column should be nullable, have a default value, or require an index.
For large tables, adding a new column can be costly. In some systems, ALTER TABLE operations run in place; in others, they rebuild the entire table. Plan for zero-downtime migrations where possible. Tools like online schema change utilities or logical replication can help.