A new column in a database table changes structure, performance, and downstream logic. It is more than a single migration step. Done right, it fits into the existing model without slowing queries or corrupting data. Done wrong, it can block deploys, lock writes, or crash production.
To add a new column, decide on the exact data type, whether it can be null, and the default value if required. Migrations should be explicit and reversible. Use transactional DDL where supported to prevent partial application. For large tables, consider adding the column without a default, then backfilling in controlled batches to avoid lock contention.
In SQL, a basic operation looks like:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
But production work often requires more. Add indexes carefully — a new index on a large column can degrade write performance. Align column ordering only if your database benefits from it, since most modern engines ignore column order for query performance.