The schema was stable, but the results were wrong. The reason was simple: a new column needed to exist.
Adding a new column is a surgical act. Done well, it improves performance and clarity. Done badly, it corrupts data and triggers downtime. The process starts with defining the column name and data type based on the rules of your schema. Keep names short but explicit. Match data types to the smallest possible footprint.
In relational databases like PostgreSQL or MySQL, migrations are the safest path. Write the ALTER TABLE statement inside a migration script. Verify it against a staging environment that mirrors production. For example:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
Always consider defaults. Without a default value, inserts may fail. If historical data matters, backfill values in controlled batches to avoid locking large tables. Monitor execution time and indexes. Adding a column to a large, heavily queried table can block reads and writes.