A new column changes everything. One command, one schema migration, and the structure of your data shifts. Whether you are working with PostgreSQL, MySQL, or SQLite, adding a new column is a surgical operation on your database. Do it right, and you gain new capabilities. Do it wrong, and you risk downtime, broken queries, and silent data loss.
To add a new column, you start at the schema level. In SQL, the ALTER TABLE statement is the standard.
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This command appends last_login to the users table. But this is only the simplest case. The real work comes in handling defaults, null constraints, and backfilling values without locking the table in production.
For large datasets, adding a new column with NOT NULL can block writes and degrade performance. A safer path is to add the column as nullable, backfill in batches, then apply the constraint in a separate migration. This ensures minimal disruption to your application's availability.