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

Ant Task: Baseline

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

baseline

Usage

<flyway:baseline />

Configuration

Attribute 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 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.
callbacks NO 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
classpath NO The Ant classpath used to load the JDBC driver and the migrations
classpathref NO The Ant classpath reference used to load the JDBC driver and the migrations

Sample configuration

<property name="flyway.driver" value="org.hsqldb.jdbcDriver"/>
<property name="flyway.url" value="jdbc:hsqldb:file:/db/flyway_sample"/>
<property name="flyway.user" value="SA"/>
<property name="flyway.password" value="mySecretPwd"/>
<property name="flyway.schemas" value="schema1,schema2,schema3"/>
<property name="flyway.table" value="schema_history"/>
<property name="flyway.callbacks" value="com.mycomp.MyCallback,com.mycomp.OtherCallback"/>
<property name="flyway.skipDefaultCallbacks" value="false"/>
<property name="flyway.baselineVersion" value="1.0"/>
<property name="flyway.baselineDescription" value="Base Migration"/>

Sample output

[flyway:baseline] Creating Metadata table: schema_version (Schema: PUBLIC)
[flyway:baseline] Schema baselined with version: 1

Ant: repair