The migration hit production at midnight. Logs lit up with schema changes. One line stood out in the diff: ALTER TABLE users ADD COLUMN last_login TIMESTAMP.
A new column is never just a new field. It changes the shape of your data, the queries you write, and the behavior of the system. Adding a column in SQL is simple on paper—ALTER TABLE table_name ADD COLUMN column_name data_type;. But in live systems with millions of rows, it’s a change that touches performance, indexes, replication, backups, and every part of the codebase that relies on that table.
Plan for the migration. Know your database’s lock behavior. In PostgreSQL, adding a column with a default value rewrites the entire table, blocking queries. In MySQL, some operations are instant, but others require a full table copy. Use online schema change tools when downtime isn’t acceptable.
Review all queries hitting the table. A nullable column may require updates to ORM models, validation logic, and CSV exports. Existing indexes won’t cover the new column unless you create them. Watch for implicit casts in joins and filters.