Class DefaultFlywayMigrator

  • All Implemented Interfaces:
    FlywayMigrator

    @ComponentProfile(summary="Perform a database migration using flyway",
                      since="3.9.2")
    public class DefaultFlywayMigrator
    extends java.lang.Object
    implements FlywayMigrator
    Perform a database migration using flyway

    In the adapter configuration file this class is aliased as flyway-jdbc-migrator which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • DefaultFlywayMigrator

        public DefaultFlywayMigrator()
    • Method Detail

      • migrate

        public void migrate​(javax.sql.DataSource source)
                     throws java.lang.Exception
        Specified by:
        migrate in interface FlywayMigrator
        Throws:
        java.lang.Exception
      • getFlywayLocations

        public java.util.List<java.lang.String> getFlywayLocations()
      • setFlywayLocations

        public void setFlywayLocations​(java.util.List<java.lang.String> flywayLocations)
        List of locations to scan recursively for migrations.

        Locations can be prefixed with classpath or filesytem. which means that filesystem:./sql/ if the files are on the filesystem or classpath:migration/mysql if they are on the classpath.

        Parameters:
        flywayLocations - the locations.
      • withFlywayLocations

        public DefaultFlywayMigrator withFlywayLocations​(java.util.List<java.lang.String> locations)
      • withFlywayLocations

        public DefaultFlywayMigrator withFlywayLocations​(java.lang.String... locations)
      • getBaseline

        public java.lang.Boolean getBaseline()
      • setBaseline

        public void setBaseline​(java.lang.Boolean baseline)
        Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.
        Parameters:
        baseline - true to baseline, default is false if not explicitly configured.
      • getFlywayTable

        public java.lang.String getFlywayTable()
      • setFlywayTable

        public void setFlywayTable​(java.lang.String flywayTable)
        Alternative schema history table.

        Optional schema history table. If provided flyway history will be created in this table.

        Parameters:
        flywayTable - the table. optional. If not provided will use the default flyway history table