Back to Flyway

Flyway Callbacks Setting

documentation/Reference/Configuration/Flyway Namespace/Flyway Callbacks Setting.md

latest1.8 KB
Original Source

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

powershell
./flyway -callbacks="my.callback.FlywayCallback,my.package.to.scan" info

TOML Configuration File

toml
[flyway]
callbacks = ["my.callback.FlywayCallback", "my.package.to.scan"]

Configuration File

properties
flyway.callbacks=my.callback.FlywayCallback,my.package.to.scan

Environment Variable

properties
FLYWAY_CALLBACKS=my.callback.FlywayCallback,my.package.to.scan

API

java
Flyway.configure()
    .callbacks("my.callback.FlywayCallback", "my.package.to.scan")
    .load()

Gradle

groovy
flyway {
    callbacks = ['my.callback.FlywayCallback', 'my.package.to.scan']
}

Maven

xml
<configuration>
    <callbacks>my.callback.FlywayCallback,my.package.to.scan</callbacks>
</configuration>