Clean
Published 15 January 2025
Description
Drops all objects in the configured schemas. If Flyway automatically created them, then the schemas themselves will be dropped when cleaning.
Do not use against your production DB!
Flyway has some default configuration to try and save you from accidents, but it can't interactively ask you if you really intended to do this.
Limitations
Usage examples
Clean via command line
flyway clean
Clean via Maven
mvn flyway:clean
Note that default phase is pre-integration-test
.
Clean via Gradle
gradle flywayClean
Parameters
Universal commandline parameters are listed here.
All relevant configuration settings are listed here. The settings from these sections can be set as parameters on the clean
command:
- General settings
- Flyway schema history settings
- Clean settings
- Settings in database-specific namespaces
- Settings in secrets management namespaces
It is also possible to set environment settings as parameters.
All parameters are optional, although a target environment must be configured or passed in.
JSON output format
{
"schemasCleaned": [
"public"
],
"schemasDropped": [],
"flywayVersion": "11.3.2",
"database": "testdb",
"warnings": [],
"operation": "clean"
}