The log table was wrong. Data was missing, and no one could explain why. The fix began with a new column.
A new column in a database is more than an extra field. It changes the shape of your data, the way queries run, and how features work. Adding one can be simple. Adding one without breaking production is harder.
To add a new column, define the schema change in your migration file. Give it a clear, short name. Use the correct data type. If it will store large text, use TEXT. If it will store integers, pick the smallest type that holds your values. Avoid over‑allocating space.
Think about defaults. A new column with no default can break inserts. A wrong default can corrupt results quietly. Set the right one from the first migration.
Run the migration in a staging environment. Backfill data if needed, but be careful with large updates. Split them into batches to avoid locking tables for too long.