The migration was live, but the schema was wrong. A missing field had stopped everything. The fix was simple: add a new column.
Creating a new column should be fast, safe, and reversible. In most databases, that means writing an ALTER TABLE statement. In PostgreSQL, MySQL, and many others, you can add a column without recreating the table. But in production, the details matter.
First, name the new column with clarity. Avoid abbreviations that make the schema cryptic six months later. Use lowercase with underscores for consistency.
Second, define the correct data type. Changing data types after the fact can lock the table or corrupt data. Choose types that reflect the true shape of the values you will store. If it’s an indexed column, think about how that index will impact write performance.
Third, decide on defaults and nullability before running the migration. Adding a non-null column without a default will fail if rows already exist. If the column should never be null, include a safe default to prevent partial data issues.