Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flyway out of order and idempotent migrations

Tags:

flyway

We are in a situation similar to this blog post from 2013.

Because there is one project that will be used by many developers, we'd like to implement the OutOfOrder functionality from Flyway. The above mentioned post however makes a claim that the SQL will have to be written using idempotent commands, such as "IF NOT EXISTS" etc.

When attempting to reproduce the issue from the post, we noticed it did not matter as OutOfOrder would apply the earlier SQL file without attempting already applied migrations.

Was this fixed since the original post? Is there anything I'm missing?

like image 381
Marc Castrovinci Avatar asked Oct 31 '22 23:10

Marc Castrovinci


1 Answers

OutOfOrder only applies unapplied versions that are made after the baseline of the database.

If the database wasn't baselined to start, then it applies all versions that have not been applied, Flyway doesn't apply any that have already been applied.

I believe that the article was referring to manually reapplying the file.

like image 62
Karl Henselin Avatar answered Jan 04 '23 14:01

Karl Henselin