The migration finished. The data was clean. But the schema still lacked the new column you needed.
Adding a new column should be simple. In many systems, it is. In production, it can turn into a risk if you don’t handle it with precision. A misstep can lock tables, block writes, or crash services that expect the schema to be static.
The safest way to add a new column starts with understanding your database engine. MySQL, PostgreSQL, and SQLite each have different behaviors. In PostgreSQL, adding a nullable column without a default is usually instant. Adding a column with a default will rewrite the table unless you use the newer default expression method. In MySQL, adding a column to a large table may require careful use of ALTER TABLE with the right algorithm flag to avoid blocking.
Plan for backward compatibility. Deploy schema changes before deploying code that uses them. This prevents errors when old code runs on new schema or new code runs on old schema. Make the column nullable or give it a safe default value until the code that writes to it is in place.