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

Gradle Task: flywayBaseline

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

baseline

Usage

> gradle flywayBaseline

Configuration

See configuration for a full list of supported configuration parameters.

Sample configuration

flyway {
    driver = 'org.hsqldb.jdbcDriver'
    url = 'jdbc:hsqldb:file:/db/flyway_sample;shutdown=true'
    user = 'SA'
    password = 'mySecretPwd'
    connectRetries = 10
    initSql = 'SET ROLE \'myuser\''
    schemas = ['schema1', 'schema2', 'schema3']
    createSchemas=true
    table = 'schema_history'
    tablespace = 'my_tablespace'
    callbacks = ['com.mycompany.proj.CustomCallback', 'com.mycompany.proj.AnotherCallback']
    skipDefaultCallbacks = false
    baselineVersion = 5
    baselineDescription = "Let's go!"
    workingDirectory = 'C:/myproject'
    jdbcProperties = [
      'someProperty' : 'someValue',
      'someOtherProperty' : 'someOtherValue'
    ]
}

Sample output

> gradle flywayBaseline -i

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

Gradle: repair