The migration failed on the last table. The logs showed the cause: a missing new column.
Adding a new column sounds simple, but in production systems it can trigger downtime, lock tables, or break dependent services. Schema changes at scale demand precision. A new column must be added without blocking reads and writes, without losing data, and without unpredictable performance hits.
The first step is to define the column and its constraints. Decide if the new column allows NULL, has a default, or needs an index. Adding defaults can lock the table depending on the database version. In PostgreSQL, adding a nullable column is fast. Adding a non-null column with a default before version 11 rewrites the entire table, which can take hours.
Plan the migration. In MySQL, use ALGORITHM=INPLACE where possible to avoid table copies. Use tools like pt-online-schema-change or gh-ost for large datasets. Always test on a staging environment with a full dataset clone. Measure execution time and verify replication lag.