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
If you use Liquibase 4.27.0 and later, it is a best practice to specify liquibase.command.dropAll.requireForce
or LIQUIBASE_COMMAND_DROP_ALL_REQUIRE_FORCE
in your liquibase.properties
file or as an environment variable. This makes it mandatory for developers to specify --force
whenever they run drop-all
in the CLI:
liquibase drop-all --force
Impact
Using the drop-all
command comes with risks of unintended consequences. Because of this, in Liquibase 4.27.0 and later, the command lets you use --require-force
to require developers to specify a --force
flag to indicate that they intend to run it.
Warning: Look for potential unintended consequences before using this command.
Command parameters
Attribute | Definition | Requirement |
---|---|---|
|
A required parameter which indicates you intend to use this feature. If you specify Liquibase 4.27.0+ only. If you use an earlier version, this flag is optional. Note: In Liquibase 4.27.0 and later, if you specify |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
If |
Optional |
|
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 |
|
Specifies whether Liquibase requires the user to specify the |
Optional |
|
Schemas to include in drop |
Optional |
|
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 |
Attribute | Definition | Requirement |
---|---|---|
|
A required parameter which indicates you intend to use this feature. If you specify Liquibase 4.27.0+ only. If you use an earlier version, this flag is optional. Note: In Liquibase 4.27.0 and later, if you specify |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
If |
Optional |
|
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 |
|
Specifies whether Liquibase requires the user to specify the |
Optional |
|
Schemas to include in drop |
Optional |
|
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 |
Attribute | Definition | Requirement |
---|---|---|
|
A required parameter which indicates you intend to use this feature. If you specify Liquibase 4.27.0+ only. If you use an earlier version, this flag is optional. Note: In Liquibase 4.27.0 and later, if you specify |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
If |
Optional |
|
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 |
|
Specifies whether Liquibase requires the user to specify the |
Optional |
|
Schemas to include in drop |
Optional |
|
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 |
Attribute | Definition | Requirement |
---|---|---|
|
A required parameter which indicates you intend to use this feature. If you specify Liquibase 4.27.0+ only. If you use an earlier version, this flag is optional. Note: In Liquibase 4.27.0 and later, if you specify |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
If |
Optional |
|
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 |
|
Specifies whether Liquibase requires the user to specify the |
Optional |
|
Schemas to include in drop |
Optional |
|
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 |
Attribute | Definition | Requirement |
---|---|---|
|
A required parameter which indicates you intend to use this feature. If you specify Liquibase 4.27.0+ only. If you use an earlier version, this flag is optional. Note: In Liquibase 4.27.0 and later, if you specify |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
If |
Optional |
|
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 |
|
Specifies whether Liquibase requires the user to specify the |
Optional |
|
Schemas to include in drop |
Optional |
|
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.
Output in Liquibase 4.27.0 and later
Value of --drop-all-require-force |
Value of --force |
Command executes? | Output message |
---|---|---|---|
true
|
true
|
Yes | Standard success message |
true
|
false or not specified |
No | ERROR: The drop-all command may result in unrecoverable destructive changes to objects at <jdbc connection info>. This message can be suppressed and the drop-all executed by adding the --force flag.
|
false or not specified |
true
|
Yes | Standard success message |
false or not specified |
false or not specified |
Yes |
Standard success message as well as the following message: |