Flyway: start multiple migrations in one transaction

I looked Flywayas a database migration tool.

The only thing I could not find a definite answer for is the following:

Can I get Flyway to run all unauthorized migrations in one transaction, instead of each migration being its own transaction?

In the dev environment, this is not a problem, but in a production environment where you could potentially perform several migrations from one update to another, one of the unsuccessful migrations would leave the database in a state of “half migration”, where some migrations were completed and some not really bad.

A workaround would be to simply slice all the SQL needed in a single file, but there are problems with this:

  • Production migrations and dev migrations will end up being done differently, since you cannot know in advance what will happen in the migration environment in dev. I think you can always do a clean and then a new migration, but that seems to contradict the spirit of the flyway design with regard to additional migrations.

  • The checksums will be different as soon as a new change is added.

Does Flyway support this feature? Is Liquibase or any other migration tool?

+4
source share
1 answer

. , , , Flyway - , Axel Fontaine , , .

: this this, /. :

, .... , .

Flyway 3 . 100 , , , , . .

Liquibase , .

+2

Source: https://habr.com/ru/post/1658448/


All Articles