Adding a new column is one of the most common yet critical schema changes. Done right, it is safe, fast, and invisible to users. Done wrong, it blocks deployments, locks tables, and takes down services.
First, know the type of column you need. Define the name, data type, nullability, and default value before you touch the database. This prevents ambiguity and avoids multiple schema changes for the same field.
Next, choose an approach that matches your database engine and environment. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable columns without defaults, but slow if you set a non-nullable default directly. In MySQL, adding a column can require a table copy depending on the storage engine and version. Always check the documentation for exact behavior.
For production systems under load, incremental changes are safer. In PostgreSQL, you can add the column as nullable, backfill the data in small batches, then add constraints in a second migration. This avoids table rewrites and reduces lock times.