Adding a new column sounds simple. It rarely is. In production databases, the stakes are high. The wrong migration can lock writes, slow queries, or break integrations. Speed matters, but so does precision.
A new column changes the shape of the data. It changes indexes, queries, and code paths. Before creation, decide on its type, constraints, and defaults. Avoid null where you can. Think about the cost of backfilling millions of rows. Test the impact on replicas and failover systems.
In SQL, adding a new column can be as straightforward as:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
But this statement is not always safe. On large tables, it may trigger a full rewrite or lock. Some databases, like PostgreSQL, can add columns with defaults instantly under certain conditions. Others cannot. Measure before and after.