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

--force=<true|false>

A required parameter which indicates you intend to use this feature. If you specify --force or --force=true, the command executes. If you omit the parameter or specify --force=false, the command does not execute. Default: false.

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 --drop-all-require-force to false, then setting --force to false does not prevent --drop-all from executing.

Required

--url=<string>

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required

--default-catalog-name=<string>

Name of the default catalog to use for the database connection

Optional

--default-schema-name=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Tip: In Liquibase v4.23.0+, camelCase for defaultSchemaName works successfully. If you are on an earlier version, camelCase may not work as expected.

Note: The syntax liquibase.command.defaultSchemaName is valid for v4.19.0+. For prior versions, use defaultSchemaName.

Optional

--driver=<string>

The JDBC driver class

Optional

--driver-properties-file=<string>

The JDBC driver properties file

Optional

--drop-dbclhistory=<true|false>

Liquibase 4.27.0+. If true, Liquibase drops the DATABASECHANGELOGHISTORY table along with other database objects owned by the user. Default: false.

Optional

--password=<string>

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

--require-force=<true|false>

Specifies whether Liquibase requires the user to specify the --force parameter to use the drop-all command. Liquibase 4.27.0+. Default: false.

Optional

--schemas=<string>

Schemas to include in drop

Optional

--username=<string>

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

cmdArgs: { force: "<true|false>" }

A required parameter which indicates you intend to use this feature. If you specify --force or --force=true, the command executes. If you omit the parameter or specify --force=false, the command does not execute. Default: false.

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 --drop-all-require-force to false, then setting --force to false does not prevent --drop-all from executing.

Required

cmdArgs: { url: "<string>" }

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required

cmdArgs: { default-catalog-name: "<string>" }

Name of the default catalog to use for the database connection

Optional

cmdArgs: { default-schema-name: "<string>" }

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Tip: In Liquibase v4.23.0+, camelCase for defaultSchemaName works successfully. If you are on an earlier version, camelCase may not work as expected.

Note: The syntax liquibase.command.defaultSchemaName is valid for v4.19.0+. For prior versions, use defaultSchemaName.

Optional

cmdArgs: { driver: "<string>" }

The JDBC driver class

Optional

cmdArgs: { driver-properties-file: "<string>" }

The JDBC driver properties file

Optional

cmdArgs: { drop-dbclhistory: "<true|false>" }

Liquibase 4.27.0+. If true, Liquibase drops the DATABASECHANGELOGHISTORY table along with other database objects owned by the user. Default: false.

Optional

cmdArgs: { password: "<string>" }

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

cmdArgs: { require-force: "<true|false>" }

Specifies whether Liquibase requires the user to specify the --force parameter to use the drop-all command. Liquibase 4.27.0+. Default: false.

Optional

cmdArgs: { schemas: "<string>" }

Schemas to include in drop

Optional

cmdArgs: { username: "<string>" }

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

liquibase.command.force: <true|false>

liquibase.command.dropAll.force: <true|false>

A required parameter which indicates you intend to use this feature. If you specify --force or --force=true, the command executes. If you omit the parameter or specify --force=false, the command does not execute. Default: false.

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 --drop-all-require-force to false, then setting --force to false does not prevent --drop-all from executing.

Required

liquibase.command.url: <string>

liquibase.command.dropAll.url: <string>

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required

liquibase.command.defaultCatalogName: <string>

liquibase.command.dropAll.defaultCatalogName: <string>

Name of the default catalog to use for the database connection

Optional

liquibase.command.defaultSchemaName: <string>

liquibase.command.dropAll.defaultSchemaName: <string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Tip: In Liquibase v4.23.0+, camelCase for defaultSchemaName works successfully. If you are on an earlier version, camelCase may not work as expected.

Note: The syntax liquibase.command.defaultSchemaName is valid for v4.19.0+. For prior versions, use defaultSchemaName.

Optional

liquibase.command.driver: <string>

liquibase.command.dropAll.driver: <string>

The JDBC driver class

Optional

liquibase.command.driverPropertiesFile: <string>

liquibase.command.dropAll.driverPropertiesFile: <string>

The JDBC driver properties file

Optional

liquibase.command.dropDbclhistory: <true|false>

liquibase.command.dropAll.dropDbclhistory: <true|false>

Liquibase 4.27.0+. If true, Liquibase drops the DATABASECHANGELOGHISTORY table along with other database objects owned by the user. Default: false.

Optional

liquibase.command.password: <string>

liquibase.command.dropAll.password: <string>

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

liquibase.command.requireForce: <true|false>

liquibase.command.dropAll.requireForce: <true|false>

Specifies whether Liquibase requires the user to specify the --force parameter to use the drop-all command. Liquibase 4.27.0+. Default: false.

Optional

liquibase.command.schemas: <string>

liquibase.command.dropAll.schemas: <string>

Schemas to include in drop

Optional

liquibase.command.username: <string>

liquibase.command.dropAll.username: <string>

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

JAVA_OPTS=-Dliquibase.command.force=<true|false>

JAVA_OPTS=-Dliquibase.command.dropAll.force=<true|false>

A required parameter which indicates you intend to use this feature. If you specify --force or --force=true, the command executes. If you omit the parameter or specify --force=false, the command does not execute. Default: false.

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 --drop-all-require-force to false, then setting --force to false does not prevent --drop-all from executing.

Required

JAVA_OPTS=-Dliquibase.command.url=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.url=<string>

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required

JAVA_OPTS=-Dliquibase.command.defaultCatalogName=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.defaultCatalogName=<string>

Name of the default catalog to use for the database connection

Optional

JAVA_OPTS=-Dliquibase.command.defaultSchemaName=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.defaultSchemaName=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Tip: In Liquibase v4.23.0+, camelCase for defaultSchemaName works successfully. If you are on an earlier version, camelCase may not work as expected.

Note: The syntax liquibase.command.defaultSchemaName is valid for v4.19.0+. For prior versions, use defaultSchemaName.

Optional

JAVA_OPTS=-Dliquibase.command.driver=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.driver=<string>

The JDBC driver class

Optional

JAVA_OPTS=-Dliquibase.command.driverPropertiesFile=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.driverPropertiesFile=<string>

The JDBC driver properties file

Optional

JAVA_OPTS=-Dliquibase.command.dropDbclhistory=<true|false>

JAVA_OPTS=-Dliquibase.command.dropAll.dropDbclhistory=<true|false>

Liquibase 4.27.0+. If true, Liquibase drops the DATABASECHANGELOGHISTORY table along with other database objects owned by the user. Default: false.

Optional

JAVA_OPTS=-Dliquibase.command.password=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.password=<string>

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

JAVA_OPTS=-Dliquibase.command.requireForce=<true|false>

JAVA_OPTS=-Dliquibase.command.dropAll.requireForce=<true|false>

Specifies whether Liquibase requires the user to specify the --force parameter to use the drop-all command. Liquibase 4.27.0+. Default: false.

Optional

JAVA_OPTS=-Dliquibase.command.schemas=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.schemas=<string>

Schemas to include in drop

Optional

JAVA_OPTS=-Dliquibase.command.username=<string>

JAVA_OPTS=-Dliquibase.command.dropAll.username=<string>

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

LIQUIBASE_COMMAND_FORCE=<true|false>

LIQUIBASE_COMMAND_DROP_ALL_FORCE=<true|false>

A required parameter which indicates you intend to use this feature. If you specify --force or --force=true, the command executes. If you omit the parameter or specify --force=false, the command does not execute. Default: false.

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 --drop-all-require-force to false, then setting --force to false does not prevent --drop-all from executing.

Required

LIQUIBASE_COMMAND_URL=<string>

LIQUIBASE_COMMAND_DROP_ALL_URL=<string>

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required

LIQUIBASE_COMMAND_DEFAULT_CATALOG_NAME=<string>

LIQUIBASE_COMMAND_DROP_ALL_DEFAULT_CATALOG_NAME=<string>

Name of the default catalog to use for the database connection

Optional

LIQUIBASE_COMMAND_DEFAULT_SCHEMA_NAME=<string>

LIQUIBASE_COMMAND_DROP_ALL_DEFAULT_SCHEMA_NAME=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Tip: In Liquibase v4.23.0+, camelCase for defaultSchemaName works successfully. If you are on an earlier version, camelCase may not work as expected.

Note: The syntax liquibase.command.defaultSchemaName is valid for v4.19.0+. For prior versions, use defaultSchemaName.

Optional

LIQUIBASE_COMMAND_DRIVER=<string>

LIQUIBASE_COMMAND_DROP_ALL_DRIVER=<string>

The JDBC driver class

Optional

LIQUIBASE_COMMAND_DRIVER_PROPERTIES_FILE=<string>

LIQUIBASE_COMMAND_DROP_ALL_DRIVER_PROPERTIES_FILE=<string>

The JDBC driver properties file

Optional

LIQUIBASE_COMMAND_DROP_DBCLHISTORY=<true|false>

LIQUIBASE_COMMAND_DROP_ALL_DROP_DBCLHISTORY=<true|false>

Liquibase 4.27.0+. If true, Liquibase drops the DATABASECHANGELOGHISTORY table along with other database objects owned by the user. Default: false.

Optional

LIQUIBASE_COMMAND_PASSWORD=<string>

LIQUIBASE_COMMAND_DROP_ALL_PASSWORD=<string>

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

LIQUIBASE_COMMAND_REQUIRE_FORCE=<true|false>

LIQUIBASE_COMMAND_DROP_ALL_REQUIRE_FORCE=<true|false>

Specifies whether Liquibase requires the user to specify the --force parameter to use the drop-all command. Liquibase 4.27.0+. Default: false.

Optional

LIQUIBASE_COMMAND_SCHEMAS=<string>

LIQUIBASE_COMMAND_DROP_ALL_SCHEMAS=<string>

Schemas to include in drop

Optional

LIQUIBASE_COMMAND_USERNAME=<string>

LIQUIBASE_COMMAND_DROP_ALL_USERNAME=<string>

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: INFO: The drop-all command may result in unrecoverable destructive changes to objects at <jdbc connection info>. To protect against unwanted drops, set 'LIQUIBASE_COMMAND_DROPALL_REQUIRE_FORCE=true' which will require a --force=true flag on the command. Learn more at https://docs.liquibase.com/dropall

Related links