Package io.micronaut.flyway
Class FlywayMigrator
- java.lang.Object
-
- io.micronaut.flyway.FlywayMigrator
-
@Singleton public class FlywayMigrator extends java.lang.ObjectPublic access to invoke Flyway migrations when DataSource onCreate behaviour is not desired.The Flyway configuration should be: flyway.enabled = true flyway.datasources.*.enabled = false
This ensures that Flyway won't run automatically the migrations. The following service can then be injected later and execute
runto execute the migrations based on a givenFlywayConfigurationProperties.- Since:
- 3.6.0
-
-
Field Summary
Fields Modifier and Type Field Description protected io.micronaut.context.ApplicationContextapplicationContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun(FlywayConfigurationProperties config, javax.sql.DataSource dataSource)Run the Flyway migrations for a specific config and a DataSource.
-
-
-
Method Detail
-
run
public void run(FlywayConfigurationProperties config, javax.sql.DataSource dataSource)
Run the Flyway migrations for a specific config and a DataSource.- Parameters:
config- TheFlywayConfigurationPropertiesdataSource- TheDataSource
-
-