Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to resolve version number conflicts of script in flywaydb

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!!

like image 946
qfrank Avatar asked Oct 31 '22 00:10

qfrank


1 Answers

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
like image 142
pards Avatar answered Nov 15 '22 07:11

pards