Package org.flywaydb.core.api.executor
Interface MigrationExecutor
-
public interface MigrationExecutorExecutes a migration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanExecuteInTransaction()Whether the execution can take place inside a transaction.voidexecute(Context context)Executes the migration this executor is associated with.
-
-
-
Method Detail
-
execute
void execute(Context context) throws SQLException
Executes the migration this executor is associated with.- Parameters:
context- The context to use to execute the migration against the DB.- Throws:
SQLException- when the execution of a statement failed.
-
canExecuteInTransaction
boolean canExecuteInTransaction()
Whether the execution can take place inside a transaction. Almost all implementation should returntrue. This however makes it possible to execute certain migrations outside a transaction. This is useful for databases like PostgreSQL and SQL Server where certain statement can only execute outside a transaction.- Returns:
trueif a transaction should be used (highly recommended), orfalseif not.
-
-