java.lang.Object
io.jooby.flyway.FlywayModule
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a new Flyway module.FlywayModule(String name) Creates a new Flyway module. -
Method Summary
Modifier and TypeMethodDescriptionvoidinstall(io.jooby.Jooby application) javaMigrations(org.flywaydb.core.api.migration.JavaMigration... migrations) The manually added Java-based migrations.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jooby.Extension
lateinit
-
Constructor Details
-
FlywayModule
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 thedbkey.
-
-
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
- Specified by:
installin interfaceio.jooby.Extension- Throws:
Exception
-