Want more control over your database deployments? – Find out how with Carlos Robles at Redgate Summit Register now

Flyway Documentation

Gradle Task: flywayClean

Drops all objects (tables, views, procedures, triggers, …) in the configured schemas.



> gradle flywayClean


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']
    callbacks = ['com.mycompany.proj.CustomCallback', 'com.mycompany.proj.AnotherCallback']
    skipDefaultCallbacks = false
    cleanDisabled = false
    workingDirectory = 'C:/myproject'
    jdbcProperties = [
      'someProperty' : 'someValue',
      'someOtherProperty' : 'someOtherValue'

Sample output

> gradle flywayClean -i

Cleaned database schema 'PUBLIC' (execution time 00:00.016s)

Gradle: info