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

Maven Goal: Clean

Drops all objects (tables, views, procedures, triggers, ...) in the configured schemas.
The schemas are cleaned in the order specified by the schemas property.

clean

Default Phase

  • pre-integration-test

Usage

> mvn flyway:clean

Configuration

Parameter 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
serverId NO flyway-db The id of the server in the Maven settings.xml file to load the credentials from.

This is an alternative to passing the credentials in directly through properties.
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 schemas will be cleaned in the order of this list.
callbacks NO Fully qualified class names of Callback 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.
cleanDisabled NO false Whether to disable clean. This is especially useful for production environments where running clean can be quite a career limiting move.
skip NO false Skips the execution of the plugin for this module
configFiles NO Additional files from which to load the Flyway configuration. The names of the individual properties match the ones you would use as Maven or System properties. The encoding of the file must be the same as the encoding defined with the flyway.encoding property, which is UTF-8 by default. Relative paths are relative to `workingDirectory`.
workingDirectory NO project.basedir (where the POM resides) The working directory to consider when dealing with relative paths for both config files and locations.

Sample configuration

<configuration>
    <driver>org.hsqldb.jdbcDriver</driver>
    <url>jdbc:hsqldb:file:${project.build.directory}/db/flyway_sample;shutdown=true</url>
    <user>SA</user>
    <password>mySecretPwd</password>
    <schemas>
        <schema>schema1</schema>
        <schema>schema2</schema>
        <schema>schema3</schema>
    </schemas>
    <callbacks>
        <callback>com.mycompany.project.CustomCallback</callback>
        <callback>com.mycompany.project.AnotherCallback</callback>
    </callbacks>
    <skipDefaultCallbacks>false</skipDefaultCallbacks>
    <cleanDisabled>false</cleanDisabled>
    <skip>false</skip>
    <configFiles>
        <configFile>myConfig.conf</configFile>
        <configFile>other.conf</configFile>
    </configFiles>
    <workingDirectory>/my/working/dir</workingDirectory>
</configuration>

Sample output

> mvn flyway:clean

[INFO] [flyway:clean {execution: default-cli}]
[INFO] Cleaned database schema 'PUBLIC' (execution time 00:00.016s)

Maven: info