The migration failed on the last row. The error was simple: missing new column in the target table.
A new column is one of the most common schema changes in any database. It sounds trivial, but done wrong, it breaks production or corrupts data. The right approach is about precision and timing.
Start by defining the new column in the schema or migration file. For relational databases, use ALTER TABLE with explicit types and constraints. Avoid implicit defaults unless you understand their performance cost. On large datasets, adding a non-null column with a default can lock the table for minutes or hours. Instead, create the column as nullable, backfill in batches, then enforce constraints.
For NoSQL stores, adding a new column means updating serialization layers and ensuring old data reads without errors. Always deploy code changes that handle both old and new schemas before writing new-column data.