Tech News
← Home  ·  All topics

Database Migration

2 GoKawiil briefs on this topic

MySQL replica upgrade exposes AUTO_INCREMENT replication bug, corrupting foreign keys

An engineer upgrading a MySQL database via a replica discovered that a table's auto-incrementing primary key was assigned in a different row order on the replica than on the source. Because six related tables had been migrated to reference these new IDs, one of them ended up pointing to completely wrong rows after the switchover, while the other five happened to remain correct.

Developer builds free rollback tool for Flyway's Community Edition using Python

A developer created a workaround that adds rollback functionality to Flyway's free Community Edition, which normally reserves database migration undo capability for paying Teams subscribers. The trick treats every rollback as a forward migration: instead of reversing an applied migration, the tool writes a new, higher-numbered migration containing the reverse SQL, then cleans up Flyway's schema history table so the recorded state matches the database and files on disk. The implementation relies entirely on standard Flyway commands rather than direct SQL execution against the database.