Adding a new column is one of the most common schema changes, but it carries risk. A poorly executed change can lock tables, impact uptime, or cause silent data corruption. Done right, it becomes a clean, forward-compatible extension of your data model.
Start by defining the new column requirements. Decide on the name, type, default value, and whether it allows nulls. Clarity here prevents future migrations. In relational databases, altering a table is not just adding metadata; it can rewrite existing rows. This is why schema changes must be planned with operational impact in mind.
For large datasets, run the change in a non-blocking way. In PostgreSQL, use ADD COLUMN with a default only if the default is cheap to write. In MySQL, be aware of whether the engine supports instant DDL for your column type; if not, avoid locking by batching changes or performing them during maintenance windows.