The database waited. Silent. Then the schema changed. A new column came to life.
Adding a new column is routine, but every change to a production database carries risk. Migrate carefully, or lose data and uptime. The process starts with understanding the impact. Will the new column store nullable values? Is there a default? Will it force a table rewrite?
In SQL, the ALTER TABLE command creates a new column:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This looks simple, but scale changes everything. On large tables, adding a column can lock writes, block reads, or spike CPU. PostgreSQL, MySQL, and other systems each handle it differently. PostgreSQL can add a nullable column fast, but a column with a non-null default triggers a full table rewrite. MySQL supports ALGORITHM=INPLACE or INSTANT, avoiding copies in some cases. Study your database version’s behavior before running the migration.