The table was correct. But the data told you something was missing—a new column.
Adding a new column is one of the simplest changes in a database schema, yet it shapes the way your application handles data going forward. When you define it clearly and migrate it cleanly, you prevent breakage in production and keep your pipelines predictable.
Start by identifying the data type and constraints. VARCHAR, INT, BOOLEAN—choose the smallest type that fits the purpose. Decide if the column should allow NULL values, have a default, or be indexed. Every flag you set now dictates performance and behavior later.
For SQL databases, a new column can be added with an ALTER TABLE statement:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
Make the change first in staging. Run all queries that touch the table. Check joins, aggregations, inserts. A new column often affects ORM models, serialization code, and API contracts. Update migrations so they are idempotent and reversible.