Package io.micronaut.flyway
Class FlywayMigrator
java.lang.Object
io.micronaut.flyway.FlywayMigrator
Public 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 run to execute the migrations based on a given FlywayConfigurationProperties.
- Since:
- 3.6.0
- Author:
- Iván López
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.micronaut.context.ApplicationContext -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(FlywayConfigurationProperties config, DataSource dataSource) Run the Flyway migrations for a specific config and a DataSource.
-
Field Details
-
applicationContext
protected final io.micronaut.context.ApplicationContext applicationContext
-
-
Method Details
-
run
Run the Flyway migrations for a specific config and a DataSource.- Parameters:
config- TheFlywayConfigurationPropertiesdataSource- TheDataSource
-