Open bp-FLN opened 4 years ago
The call order is framework related. Have you tried to use a more recent Grails 3.3.x version?
Yes, we noticed this while upgrading from 3.1 to 3.3.11 (currently latest version). We also tried 3.3.1 (the one mentioned in the grails-core issue) but exactly same (broken) behaviour.
While upgrading our app to grails 3.3.11 we noticed that flyway runs after the db schema validation now. After some googling we found this grails issue and also your SO question. From there it looks like this has been fixed in grails 3.3.1, but for us the db schema validation still runs before flyway migration. So the patches from the github issue don't seem to fix the issue. We also tried grails 3.3.1 but same issue there.
I just debugged some more and it looks like the code in
GrailsFlywayGrailsPlugin#doWithSpring
is executed first, then db schema validation happens (viaSchemaManagementToolCoordinator
) and last theFlyway
constructor is called.Any ideas?