When you add a new column to a production database, the stakes are high. Schema drift can break deployments. Queries can fail. APIs can return malformed data. The process must be planned, tested, and rolled out without downtime.
A new column in SQL alters the structure of a table, expanding the set of fields each row contains. In PostgreSQL and MySQL, the ALTER TABLE command appends the column definition. This definition includes the column name, data type, default value, constraints, and whether it allows nulls. Even a single misstep can cascade into runtime errors across services.
Best practice starts with backward compatibility. First, add the new column as nullable or with a safe default. Deploy that change independently before integrating it into application logic. The application should read from the new column only after it is present in all environments. Once the column is populated and stable, you can add constraints or make it non-null.