Interface MigrationCallback
public interface MigrationCallback
Code run at a point of a migration run, as Flyway's Callback is: before
and after migrate, each migration, validate, undo and the other
commands. A SQL script named after the event (beforeMigrate.sql,
afterEachMigrate__grants.sql) is the other kind; both run, scripts first.
The events are the constants of this interface, spelled as Flyway spells them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(String event, MigrationContext context) Runs forevent.booleanWhether to be called forevent.
-
Field Details
-
BEFORE_MIGRATE
- See Also:
-
BEFORE_EACH_MIGRATE
- See Also:
-
AFTER_EACH_MIGRATE
- See Also:
-
AFTER_EACH_MIGRATE_ERROR
- See Also:
-
AFTER_MIGRATE
- See Also:
-
AFTER_MIGRATE_ERROR
- See Also:
-
BEFORE_UNDO
- See Also:
-
BEFORE_EACH_UNDO
- See Also:
-
AFTER_EACH_UNDO
- See Also:
-
AFTER_UNDO
- See Also:
-
AFTER_UNDO_ERROR
- See Also:
-
BEFORE_VALIDATE
- See Also:
-
AFTER_VALIDATE
- See Also:
-
AFTER_VALIDATE_ERROR
- See Also:
-
BEFORE_CLEAN
- See Also:
-
AFTER_CLEAN
- See Also:
-
BEFORE_INFO
- See Also:
-
AFTER_INFO
- See Also:
-
BEFORE_REPAIR
- See Also:
-
AFTER_REPAIR
- See Also:
-
BEFORE_BASELINE
- See Also:
-
AFTER_BASELINE
- See Also:
-
-
Method Details
-
supports
Whether to be called forevent. -
handle
Runs forevent. A failure of abeforeevent stops the command; a failure of anafterEach...Erroror...Errorevent is logged under the failure that caused it.- Throws:
Exception
-