Interface JavaMigration


public interface JavaMigration

A migration written in Java, for a change SQL cannot express: recomputing a column, moving data between tables with logic in between.

It runs once, in version order with the SQL migrations, inside the same transaction a script would get. It has no checksum, so editing the class after it ran is not detected.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Applies the change.
  • Method Details

    • migrate

      void migrate(MigrationContext context) throws IOException
      Applies the change.
      Parameters:
      context - the connection the migration runs on
      Throws:
      IOException - if the database refuses a statement; the migration is then rolled back where the engine can roll schema changes back, and recorded as failed where it cannot