Interface JavaBasedMigration

All Superinterfaces:
Migration

public non-sealed interface JavaBasedMigration extends Migration
Interface to be implemented for Java-based migrations.
Since:
0.0.1
Author:
Michael J. Simons
  • Method Details

    • getVersion

      default MigrationVersion getVersion()
      Description copied from interface: Migration
      Returns the version.
      Specified by:
      getVersion in interface Migration
      Returns:
      the version
    • getOptionalDescription

      default Optional<String> getOptionalDescription()
      Description copied from interface: Migration
      Returns An optional description of this migration.
      Specified by:
      getOptionalDescription in interface Migration
      Returns:
      An optional description of this migration
    • getSource

      default String getSource()
      Description copied from interface: Migration
      Returns something that describes the source of this migration.
      Specified by:
      getSource in interface Migration
      Returns:
      something that describes the source of this migration
    • isRepeatable

      default boolean isRepeatable()
      Return true to mark this Java based migration explicitly as repeatable. By default, a Java based migration will be repeatable when it's name matches the repeatable version pattern Rxzy__Something_something.java, it will always be repeated as the default checksum is empty.

      You can take full control over this by overwriting this method and in addition, Migration.getChecksum() and react in that according to your needs.

      Specified by:
      isRepeatable in interface Migration
      Returns:
      true if this is a repeatable migration
      Since:
      2.0.0
    • getDefaultConstructorFor

      static <T extends JavaBasedMigration> Constructor<T> getDefaultConstructorFor(Class<T> c) throws NoSuchMethodException
      Helper method for retrieving the default constructor of a given class. When such a constructor exist, it will be made accessible.
      Type Parameters:
      T - The type of the class
      Parameters:
      c - The class whose constructor should be returned
      Returns:
      The default constructor
      Throws:
      NoSuchMethodException - If there is no such default constructor
      Since:
      1.13.0