Baselines an existing database, excluding all migrations up to and including baselineVersion.
> sbt flywayBaseline
Parameter | Required | Default | Description |
---|---|---|---|
flywayUrl | YES | The jdbc url to use to connect to the database | |
flywayDriver | NO | Auto-detected based on url | The fully qualified classname of the jdbc driver to use to connect to the database |
flywayUser | NO | The user to use to connect to the database | |
flywayPassword | NO | The password to use to connect to the database | |
flywaySchemas | 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. |
flywayTable | 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. |
flywayCallbacks | NO | Fully qualified class names of FlywayCallback implementations to use to hook into the Flyway lifecycle. | |
flywaySkipDefaultCallbacks | NO | false | Whether default built-in callbacks (sql) should be skipped. If true, only custom callbacks are used. |
flywayBaselineVersion | NO | 1 | The version to tag an existing schema with when executing baseline |
flywayBaselineDescription | NO |
|
The description to tag an existing schema with when executing baseline |
flywayDriver := "org.hsqldb.jdbcDriver" flywayUrl := "jdbc:hsqldb:file:target/flyway_sample;shutdown=true" flywayUser := "SA" flywayPassword := "mySecretPwd" flywaySchemas := Seq("schema1", "schema2", "schema3") flywayTable := "schema_history" flywayCallbacks := Seq("com.mycompany.CustomCallback", "com.mycompany.AnotherCallback") flywaySkipDefaultCallbacks := false flywayBaselineVersion := "5" flywayBaselineDescription := "Let's go!"
> sbt flywayBaseline [info] Creating Metadata table: "PUBLIC"."schema_version" [info] Schema baselined with version: 1