The schema was wrong. A new column had to be added, now.
A new column is one of the simplest and most consequential changes in any database. It changes the shape of the data, the performance of queries, and the way applications interact with their backend. Done well, it is seamless. Done wrong, it creates downtime, data loss, or silent corruption.
When adding a new column, start with intent. Define the column name, type, constraints, and default values. Avoid nullable columns unless they are essential. Each choice here affects storage, indexing, and query plans.
Run the change in a controlled environment first. Use migration scripts that can be applied and rolled back. Test for the effects on existing queries, especially those returning large result sets. Check that indexes still work as expected.
Be mindful of lock times. In large tables, adding a new column can cause a full table rewrite. Plan migrations for off-peak hours or use online schema change tools that minimize impact. Consider splitting the migration into multiple steps if the system is under constant load.