We have a similar migration tool we built a long time ago, and this project has a bug that we had to address.<p>When you have to branches that each have a migration, you end up with 2 copies of N_N+1.sql, or worse yet, things that subtly merge w&#x2F;o error, meaning you have committed migrations that might not run. Or the conflict-resolution process cascades painfully as you &quot;re-sequence&quot; your migrations.<p>We ended up moving to a solution based on a manifest file; there is a single migrations.json that enumerates the exact order in which migrations must be applied. It causes merge conflicts whenever you have migrations that need their &quot;application order&quot; resolved, and it&#x27;s fixable just by re-arraning the manifest; no file renaming required. It&#x27;s been pretty robust so far.