Flyway

Command-line - baseline

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 10.20.1 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": "10.20.1",
  "database": "testdb",
  "warnings": [],
  "operation": "baseline"
}

Didn't find what you were looking for?