Adding a new column sounds simple. In practice, it can break production if handled poorly. Schema changes ripple through queries, indexes, and APIs. The goal is to make the change visible where needed, invisible where not, and accomplish it without downtime.
In SQL, the process starts with ALTER TABLE. On small datasets you can run it directly:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP NULL;
On large datasets, this can lock the table. That means slow queries, timeouts, or worse. To avoid that, use tools like pt-online-schema-change or native database features like ALTER TABLE ... ADD COLUMN with ONLINE or CONCURRENTLY flags where available.
A new column affects ORM models. Update your entity definitions. Review query builders and migrations. Ensure column defaults behave as expected. For example, a NOT NULL column needs a safe initial value or the migration will fail.