The schema was wrong, and everyone knew it. A new column had to be added, or the system would keep bleeding queries on every join.
Adding a new column in a production database changes everything. It shifts your read patterns. It alters indexes. It creates risk. The safest path is to plan it like a deployment, not a hotfix. Decide on the column name, type, nullability, and default values up front. Think through how it interacts with existing data and application code.
In PostgreSQL, MySQL, or most modern SQL databases, the DDL syntax is simple:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT NOW();
The command is easy. The impact is not. On large tables, even adding a nullable column can lock writes or slow reads. Some databases rewrite the entire table behind the scenes. That can cause replication lag or block downstream jobs. Use online schema change tools or database-native features like PostgreSQL’s ADD COLUMN with default expressions that avoid full rewrites.