Adding a new column to a database sounds simple. It is not. A careless change can lock rows, slow queries, or take your service offline. You must plan for data type, nullability, defaults, indexing, and migration strategy.
In SQL, the basic syntax is direct:
ALTER TABLE table_name
ADD COLUMN column_name data_type;
This works, but production databases demand more care. For large tables, add the column without defaults first to avoid long locks. Then backfill in controlled batches. Only after that should you set constraints or indexes. Each step reduces risk.
If your system uses an ORM, confirm how it generates schema changes. Some ORMs will combine operations into one expensive migration. Break them apart when needed. Always run schema changes in a staging environment before touching production.