drop-all
drop-all
drops all database objects owned by the user. drop-all
will not drop functions, procedures, or packages for Liquibase Open Source. Functions, procedures, packages, and synonyms can only be dropped for Liquibase Pro supported objects.
Uses
drop-all
is typically used when there is a need to prepare an environment schema to be identical to another environment schema. drop-all
is useful in the developer and test environments to remove unwanted objects to reset the database to "empty".
The command makes it easier to standardize another schema, compared to manually deleting the objects, or dropping and recreating the desired schema.
drop-all
should not be used in a production environment to prevent removal of required objects.
Syntax
To run the drop-all
command, specify the driver, classpath, and URL in the Liquibase properties file. For more information, see Create and Configure a liquibase.properties File. You can also specify these properties in your command line.
Then run the drop-all
command:
liquibase drop-all
Command arguments
Tip: For best results, specify all commands and parameters in the --kebab-case
format in the CLI. If your preference is camelCase, it also works in the CLI.
Attribute | Definition | Requirement |
---|---|---|
--url
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
--default-catalog-name
|
Name of the default catalog to use for the database connection |
Optional |
--default-schema-name
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
--driver
|
The JDBC driver class |
Optional |
--driver-properties-file
|
The JDBC driver properties file |
Optional |
--password
|
Password to connect to the target database. Tip: It is a best practice to store sensitive data in a Secrets Management tool with Liquibase Pro. |
Optional |
--schemas
|
Schemas to include in drop |
Optional |
--username
|
Username to connect to the target database. Tip: It is a best practice to store sensitive data in a Secrets Management tool with Liquibase Pro. |
Optional |
Note: The username
and password
attributes are not required for connections and systems which use alternate means of authentication. Also, you can specify database credentials as part of the url
attribute.
Output
When successful, the drop-all
command produces the following output:
Liquibase Pro 3.9.0 licensed to Liquibase Pro Customer until Tue Sep 22 19:00:00 CDT 2020
All objects dropped from MVN_UAT@jdbc:oracle:thin:@support.datical.net:1521:ORCL
Liquibase command 'drop-all' was executed successfully.
Related links
- Maven dropAll
- Ant dropAllDatabaseObjects