Redgate Flyway

Flyway Baseline On Migrate Setting

Description

Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.

This schema will then be marked with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied.

Notes

  • Flyway will check the schemas you have specified to decide whether your database is empty. If the database appears empty, the baseline is skipped, which means no baseline marker will be recorded in this database.
  • This differs slightly from calling the baseline command directly. The baseline command does not check whether the database is empty, and always records a baseline marker in the schema history table.

Why should I use this ?

It is a convenience instead of running a separate baseline step 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!

Type

Boolean

Default

false

Usage

Flyway Desktop

This can't be set in a config file via Flyway Desktop, although it will be honored, and it can be configured as an advanced parameter in operations on the Migrations page.

Command-line

flyway -baselineOnMigrate="true" migrate

TOML Configuration File

[flyway]
baselineOnMigrate = true

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>

This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved


Didn't find what you were looking for?