afterEachMigrate fails, migration succeeds, but migration not written to schema_version #1025
Milestone
Comments
Yeah, if you look at DbMigrate.java in the source code, you can see that the beforeEachMigrate and afterEachMigrate callbacks are being run in independent transactions. This was causing issues for me when flyway was trying to re-apply a migration that had already been applied before the afterEachMigrate callback failed. |
I think that this should be considered a bug. |
I completely agree. It's very easy to reproduce as well. |
Do you feel a single transaction for all beforeEachMigrate callbacks, as well as the migration itself and all afterEachMigrate callbacks would be the way to go? |
Yeah, doing it all in one transaction would be perfect. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My afterEachMigrate SQL callback script failed due to some external reason.
According to the attached output, flyway thought that it rolled-back the patch that preceded the callback but it didn't. I suspect that the migration and the post-migration callback run in separate transactions.
The text was updated successfully, but these errors were encountered: