Adding a new column is one of the most common schema changes, but speed and reliability matter. Done poorly, it blocks writes, locks rows, and breaks dependencies. Done well, it’s seamless and invisible.
First, decide if the new column belongs in the same table. Check normalization. If the data fits the entity and won’t explode size, proceed. If not, build a separate table with a foreign key.
In SQL, adding a column is simple:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
But this is not always safe in production. Large tables can stall during schema migrations. To avoid downtime, use an online migration tool. On Postgres, ALTER TABLE ... ADD COLUMN is fast if the column has no default and is nullable. For MySQL, consider pt-online-schema-change or native online DDL.