Open pme123 opened 4 years ago
Were you able to solve it? I have the same issue.
No, sorry
I don't understand. Isn't this a show-stopper? What is the whole point of flyway-play if it cannot perform the migrations?
I am not maintaining this project, just want to add my comment: Currently there is no way to eagerly run flyway migrations in DEV mode, since this is by design of the this project to run migrations only when requests come in (again, in dev mode), see this line here.
You could try to:
PlayInitializer.scala
and modify it so also in dev mode flyways.migrate(dbName)
(or flyways.checkState(dbName)
?) gets executed.PlayInitializer
now (line 23)application.conf
you then need to enable your custom module from 2. :point_up: instead of the orginal flyway-play module, something like play.modules.enabled += "my.org.flywaydb.PlayModule"
What I want to do is to run the migration eagerly before other Components need the database.
I tried to inject the
FlywayPlayComponents
into my Setup, like:But
AppSetup
is still run first and the Flyway migration is run with the first request.Is there a way to do this or do I miss something?
I also created a Stackoverflow question:
https://stackoverflow.com/questions/60303933/how-to-do-flyway-migrations-eager-in-play-framework