Class FlywayMigrator


  • @Singleton
    public class FlywayMigrator
    extends java.lang.Object
    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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected io.micronaut.context.ApplicationContext applicationContext  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run​(FlywayConfigurationProperties config, javax.sql.DataSource dataSource)
      Run the Flyway migrations for a specific config and a DataSource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • applicationContext

        protected final io.micronaut.context.ApplicationContext applicationContext