Adding a new column to a database is one of the most common schema changes. It looks simple. It can be dangerous. Done right, it ships without downtime and without breaking queries. Done wrong, it locks tables, stalls writes, and burns deploy windows.
A new column changes storage, indexes, and queries. It changes ORM models, migrations, and API contracts. It should be planned with atomic steps. First, apply the schema migration. Then backfill in batches. Then update application code to use the new column. Never reverse those steps in production.
In SQL, the command is direct:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
On small datasets, the operation is instant. On large tables, it may block writes. Use online DDL tools like pt-online-schema-change or native options like PostgreSQL’s ADD COLUMN without NOT NULL to avoid full table rewrites. Always test in staging with real data volume.