Adding a new column is one of the most common schema changes. Done right, it’s simple. Done wrong, it can cause downtime, lock tables, or break application logic. The key is to plan the migration, understand the constraints of your database engine, and execute with zero-impact deployment strategies.
First, define the purpose of the new column. Specify its name, data type, default value, and whether it allows NULLs. Avoid vague names—future maintainers should know the intent at a glance.
Second, analyze existing load. In PostgreSQL, adding a nullable column with no default is instant. Adding a column with a non-null default rewrites the table and can block writes. In MySQL, the behavior depends on the storage engine and version. For large tables, consider adding a nullable column first, then updating values in batches, then altering constraints.