documentation/Reference/Configuration/Flyway Namespace/Flyway Baseline On Migrate Setting.md
Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.
This schema will then be baselined with the
baselineVersion before executing the migrations.
Only migrations above baselineVersion will then be applied.
Note - Flyway will check the schemas you have specified to decide whether your database is empty. If the database appears empty and a relevant baseline script exists then Flyway will attempt to execute it as part of the migration.
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!
Boolean
false
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.
flyway -baselineOnMigrate="true" migrate
[flyway]
baselineOnMigrate = true
flyway.baselineOnMigrate=true
FLYWAY_BASELINE_ON_MIGRATE=true
Flyway.configure()
.baselineOnMigrate(true)
.load()
flyway {
baselineOnMigrate = true
}
<configuration>
<baselineOnMigrate>true</baselineOnMigrate>
</configuration>