Flyway Callbacks Setting
Published 15 January 2025
Description
Array of fully qualified class names of Callback implementations to use to hook into the Flyway lifecycle, or packages to scan for these classes. Ensure the class or package is available on the classpath (see Adding to the classpath).
Note: SQL callbacks matching the correct name pattern are loaded from locations (see Callbacks). This configuration parameter is only used for loading java callbacks. To disable loading sql callbacks, see skipDefaultCallbacks.
Type
String array
Default
["db/callback"]
Usage
Flyway Desktop
This can't be set in a config file via Flyway Desktop, although it will be honoured, and it can be configured as an advanced parameter in operations on the Migrations page.
Command-line
./flyway -callbacks="my.callback.FlywayCallback,my.package.to.scan" info
TOML Configuration File
[flyway]
callbacks = ["my.callback.FlywayCallback", "my.package.to.scan"]
Configuration File
flyway.callbacks=my.callback.FlywayCallback,my.package.to.scan
Environment Variable
FLYWAY_CALLBACKS=my.callback.FlywayCallback,my.package.to.scan
API
Flyway.configure()
.callbacks("my.callback.FlywayCallback", "my.package.to.scan")
.load()
Gradle
flyway {
callbacks = ['my.callback.FlywayCallback', 'my.package.to.scan']
}
Maven
<configuration>
<callbacks>my.callback.FlywayCallback,my.package.to.scan</callbacks>
</configuration>