Get the most out of Flyway v7 - Sign up for our webinar on the Redgate Hub ▶ Watch now

Command-line: 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

Usage

> flyway [options] clean

Options

See configuration for a full list of supported configuration parameters.

Sample configuration

flyway.driver=org.hsqldb.jdbcDriver
flyway.url=jdbc:hsqldb:file:/db/flyway_sample
flyway.user=SA
flyway.password=mySecretPwd
flyway.connectRetries=10
flyway.initSql=SET ROLE 'myuser'
flyway.schemas=schema1,schema2,schema3
flyway.callbacks=com.mycomp.project.CustomCallback,com.mycomp.project.AnotherCallback
flyway.skipDefaultCallbacks=false
flyway.cleanDisabled=false
flyway.workingDirectory=C:/myProject
flyway.jdbcProperties.myProperty=value

Sample output

> flyway clean

Flyway 7.0.4 by Redgate

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

Sample JSON output

> flyway clean -outputType=json

{
  "schemasCleaned": [
    "public"
  ],
  "schemasDropped": [],
  "flywayVersion": "7.0.0",
  "database": "testdb",
  "warnings": []
}

Command-line: info