Get the most out of Flyway v7 - Sign up for our webinar on the Redgate Hub ▶ Watch now

Command-line: baseline

Baselines an existing database, excluding all migrations up to and including baselineVersion.

baseline

Usage

> flyway [options] baseline

Options

See configuration for a full list of supported configuration parameters.

Sample configuration

flyway.driver=org.hsqldb.jdbcDriver
flyway.url=jdbc:hsqldb:file:/db/flyway_sample
flyway.user=SA
flyway.password=mySecretPwd
flyway.connectRetries=10
flyway.initSql=SET ROLE 'myuser'
flyway.schemas=schema1,schema2,schema3
flyway.table=schema_history
flyway.tablespace=my_tablespace
flyway.callbacks=com.mycomp.project.CustomCallback,com.mycomp.project.AnotherCallback
flyway.skipDefaultCallbacks=false
flyway.baselineVersion=1.0
flyway.baselineDescription=Base Migration
flyway.workingDirectory=C:/myProject
flyway.createSchemas=true
flyway.jdbcProperties.myProperty=value

Sample output

> flyway baseline

Flyway 7.0.4 by Redgate

Creating schema history table: "PUBLIC"."flyway_schema_history"
Schema baselined with version: 1

Sample JSON output

> flyway baseline -outputType=json

{
  "successfullyBaselined": true,
  "baselineVersion": "1",
  "flywayVersion": "7.0.0",
  "database": "testdb",
  "warnings": []
}

Command-line: repair