When data changes, schemas must change with it. Adding a new column is simple in concept, but the execution decides whether the update is instant or causes downtime. Whether your database is Postgres, MySQL, or a cloud-native service, the pattern is the same. A well-planned schema migration ensures no lost writes, no locked reads, and no failed deploys.
In SQL, the most direct way to add a new column is the ALTER TABLE command:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This works for small datasets. For large tables under heavy write load, the naive approach can block queries and trigger timeouts. Experienced teams use rolling migrations, online schema change tools, or feature-flagged rollouts. These keep production systems responsive while the new column is deployed.
A NULL default can avoid costly rewrites of existing rows. Avoid NOT NULL without a default when adding a column in production, as it forces a full table update. If the column must be NOT NULL, first create it as nullable, backfill in batches, then alter it to enforce the constraint. This staged approach reduces table lock time and lets you deploy safely without halting traffic.