Class LiquibaseMigrator

All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<DataSource>, EventListener

@Singleton public class LiquibaseMigrator extends AbstractLiquibaseMigration
Public access to invoke Liquibase migrations when DataSource onCreate behaviour is not desired.

The Liquibase configuration should be: liquibase.enabled = true liquibase.datasources.*.enabled = false

This ensures that Liquibase won't run automatically the migrations. The following service can then be injected later and either forceRun or safeRun a migration based on a given LiquibaseConfigurationProperties.

Since:
3.2.0
Author:
Kevin Jouper, Iván López
  • Constructor Details

    • LiquibaseMigrator

      public LiquibaseMigrator(io.micronaut.context.ApplicationContext applicationContext, liquibase.resource.ResourceAccessor resourceAccessor, @Nullable @Nullable io.micronaut.jdbc.DataSourceResolver dataSourceResolver)
      Parameters:
      applicationContext - The application context
      resourceAccessor - An implementation of ResourceAccessor
      dataSourceResolver - The data source resolver
  • Method Details