Want to deploy your JVM, Node.js and Go apps effortlessly to AWS? Try our service Boxfuse

Command-line: baseline

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

baseline

Usage

> flyway [options] baseline

Options

Option Required Default Description
url YES The jdbc url to use to connect to the database
driver NO Auto-detected based on url The fully qualified classname of the jdbc driver to use to connect to the database
user NO The user to use to connect to the database
password NO The password to use to connect to the database
schemas NO default schema of the connection Comma-separated case-sensitive list of schemas managed by Flyway.
The first schema will be the one containing the metadata table.
table NO schema_version The name of Flyway's metadata table.
By default (single-schema mode) the metadata table is placed in the default schema for the connection provided by the datasource.
When the flyway.schemas property is set (multi-schema mode), the metadata table is placed in the first schema of the list.
jarDirs NO <install-dir>/jars Comma-separated list of directories containing JDBC drivers and Java-based migrations
callbacks NO Comma-separated list of fully qualified class names of FlywayCallback implementations to use to hook into the Flyway lifecycle.
skipDefaultCallbacks NO false Whether default built-in callbacks (sql) should be skipped. If true, only custom callbacks are used.
baselineVersion NO 1 The version to tag an existing schema with when executing baseline
baselineDescription NO << Flyway Baseline >> The description to tag an existing schema with when executing baseline

Sample configuration

flyway.driver=org.hsqldb.jdbcDriver
flyway.url=jdbc:hsqldb:file:/db/flyway_sample
flyway.user=SA
flyway.password=mySecretPwd
flyway.schemas=schema1,schema2,schema3
flyway.table=schema_history
flyway.callbacks=com.mycomp.project.CustomCallback,com.mycomp.project.AnotherCallback
flyway.skipDefaultCallbacks=false
flyway.baselineVersion=1.0
flyway.baselineDescription=Base Migration

Sample output

> flyway baseline

Flyway 4.0.3 by Boxfuse

Creating Metadata table: "PUBLIC"."schema_version"
Schema baselined with version: 1

Command-line: repair