Class FlywayModule

java.lang.Object
io.jooby.flyway.FlywayModule
All Implemented Interfaces:
io.jooby.Extension

public class FlywayModule extends Object implements io.jooby.Extension
Flyway database migration module: https://jooby.io/modules/flyway.

Usage:

- Add hikari and flyway dependency

- Install them


 {
   install(new HikariModule());

   install(new FlywayModule());
 }
 
The default command is migrate which is controlled by the flyway.run application configuration property.

You can specify multiple commands: flyway.run = [clean, migrate] Complete documentation is available at: https://jooby.io/modules/flyway.

Since:
2.0.0
Author:
edgar
  • Constructor Details

    • FlywayModule

      public FlywayModule(@NonNull String name)
      Creates a new Flyway module.
      Parameters:
      name - The name/key of the data source to attach.
    • FlywayModule

      public FlywayModule()
      Creates a new Flyway module. Use the default/first datasource and register objects using the db key.
  • Method Details

    • javaMigrations

      public FlywayModule javaMigrations(@NonNull org.flywaydb.core.api.migration.JavaMigration... migrations)
      The manually added Java-based migrations. These are not Java-based migrations discovered through classpath scanning and instantiated by Flyway. Instead, these are manually added instances of JavaMigration. This is particularly useful when working with a dependencies, where you may want to instantiate the class and wire up its dependencies.
      Parameters:
      migrations - The manually added Java-based migrations. An empty array if none.
      Returns:
      This module.
    • install

      public void install(@NonNull io.jooby.Jooby application) throws Exception
      Specified by:
      install in interface io.jooby.Extension
      Throws:
      Exception