Skip to content

How to do Flyway migrations eager in Play Framework #89

Description

@pme123

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:

    @Singleton
    class AppSetup @Inject()(val environment: Environment,
                                val webCommands: WebCommands,
                                val configuration: Configuration,
                           )
      extends FlywayPlayComponents {
    
      flywayPlayInitializer
      ...

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions