how to resolve version number conflicts of script

2019-04-09 00:03发布

问题:

I got 3 git branches: develop, fixbug, and master.

The latest FlywayDB script version in branch master is 1.2.43, and the one in branch develop is 1.2.54. Branch fixbug's script version is update to 1.2.55, and it is based on branch master.

I need to merge branch fixbug to branch master, and to deploy master(version 1.2.55) to production environment first. As we know, flywayDB executes scripts in order, from low version to high version. If I do so, when I deploy branch develop(version 1.2.54) to the production evironment, the scripts will not be executed or even assert errors.

How should I do? Thanks!!

回答1:

There's a great blog post about that.

It can be summarised as:

  1. Prefix your migrations with timestamps rather than integers
  2. Enable out of order migrations
  3. Create idempotent migrations