Interface SpringJdbcMigration

  • All Known Implementing Classes:

    public interface SpringJdbcMigration
    Extend JavaMigration or BaseJavaMigration instead. Will be removed in Flyway 6.0.
    Interface to be implemented by Spring Jdbc Java Migrations. By default the migration version and description will be extracted from the class name. This can be overridden by also implementing the MigrationInfoProvider interface, in which case it can be specified programmatically. The checksum of this migration (for validation) will also be null, unless the migration also implements the MigrationChecksumProvider, in which case it can be returned programmatically.

    When the JdbcMigration implements ConfigurationAware, the master FlywayConfiguration is automatically injected upon creation, which is especially useful for getting placeholder and schema information.

    It is encouraged not to implement this interface directly and subclass BaseSpringJdbcMigration instead.
    • Method Detail

      • migrate

        void migrate​(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
              throws Exception
        Executes this migration. The execution will automatically take place within a transaction, when the underlying database supports it.
        jdbcTemplate - The jdbcTemplate to use to execute statements.
        Exception - when the migration failed.