Redgate Summit – The Database DevOps Transformation Watch now
PASS Data Community Summit logo

PASS Data Community Summit

A hybrid conference in Seattle and online

15-18 November

Flyway Documentation

This documentation is deprecated. The new documentation can now be found on documentation.red-gate.com

Poll

Baseline On Migrate

Description

Whether to automatically call baseline when migrate is executed against a non-empty schema with no metadata table. This schema will then be baselined with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied.

This is useful for initial Flyway production deployments on projects with an existing DB.

Be careful when enabling this as it removes the safety net that ensures Flyway does not migrate the wrong database in case of a configuration mistake!

Default

false

Usage

Commandline

./flyway -baselineOnMigrate="true" migrate

Configuration File

flyway.baselineOnMigrate=true

Environment Variable

FLYWAY_BASELINE_ON_MIGRATE=true

API

Flyway.configure()
    .baselineOnMigrate(true)
    .load()

Gradle

flyway {
    baselineOnMigrate = true
}

Maven

<configuration>
    <baselineOnMigrate>true</baselineOnMigrate>
</configuration>