Interface DbMigrationAction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DbMigrationAction
Provides a migration step that executes Java logic, for instance to transform data in ways that can't be expressed as a single query.

Actions are declared in a migration with DbMigration.add(DbMigrationAction) and execute in sequence with the other steps. They run when the migration is executed, not when it is declared, which means that you have to use the query manager that is passed in since DbMigration.datasource() isn't available anymore at that point.

Since:
1.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes this migration step.
  • Method Details

    • execute

      void execute(DbQueryManager manager) throws Exception
      Executes this migration step.

      This method will be called in the order in which the step was declared, inside the transaction of the migration that it belongs to.

      Parameters:
      manager - the query manager of the datasource that is being migrated
      Throws:
      Exception - when an error occurred during the execution of the step
      Since:
      1.10