Maven dropAll
dropAll
drops all database objects owned by the user. dropAll
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
dropAll
is typically used when there is a need to prepare an environment schema to be identical to another environment schema. dropAll
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.
dropAll
should not be used in a production environment to prevent removal of required objects.
Maven configuration
You can configure Liquibase Maven in multiple ways. You can pass arguments like <changeLogFile>
in Maven directly in your pom.xml
file, in a liquibase.properties
file referenced in your POM, as environment variables, or as JVM system properties.
Tip: For more information about the Maven configuration, see Configuring Maven.
Running the dropAll
Maven goal
Running the dropAll
goal requires a Maven project to be implemented.
To run the goal, type the following in your command prompt:
mvn liquibase:dropAll
When successful, the dropAll
Maven goal produces the following output:
$ mvn liquibase:dropAll
[INFO] Scanning for projects...
[INFO] Parsing Liquibase Properties File /Users/support.liquibase.net/Maven-Projects/OraMaven/local.liquibase.properties for changeLog parameters
[INFO] Executing on Database: jdbc:oracle:thin:@support.datical.net:1521:ORCL
[INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
[INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
[INFO] SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE
[INFO] Successfully acquired change log lock
[INFO] Dropping Database Objects in schema: MVN_UAT.MVN_UAT
[INFO] SELECT MD5SUM FROM DATABASECHANGELOG WHERE MD5SUM IS NOT NULL AND ROWNUM=1
[INFO] SELECT OWNER, CONSTRAINT_NAME, TABLE_NAME, SEARCH_CONDITION, STATUS, VALIDATED FROM all_constraints WHERE constraint_type = 'C' AND SEARCH_CONDITION IS NOT NULL and owner='MVN_UAT'
[INFO] SELECT NULL AS SYNONYM_CATALOG_NAME, ALL_SYNONYMS.OWNER AS SYNONYM_SCHEMA_NAME, SYNONYM_NAME, NULL AS OBJECT_CATALOG_NAME, TABLE_OWNER AS OBJECT_SCHEMA_NAME, TABLE_NAME AS OBJECT_NAME, NULL AS OBJECT_TYPE FROM ALL_SYNONYMS WHERE (ALL_SYNONYMS.OWNER='MVN_UAT' OR (ALL_SYNONYMS.OWNER='PUBLIC' and ALL_SYNONYMS.TABLE_OWNER='MVN_UAT'))
[INFO] SELECT sequence_name,
CASE WHEN increment_by > 0
THEN CASE WHEN min_value=1 THEN NULL ELSE min_value END
ELSE CASE WHEN min_value=(-999999999999999999999999999) THEN NULL else min_value END
END AS min_value,
CASE WHEN increment_by > 0
THEN CASE WHEN max_value=999999999999999999999999999 THEN NULL ELSE max_value END
ELSE CASE WHEN max_value=last_number THEN NULL else max_value END
END AS max_value,
CASE WHEN increment_by = 1 THEN NULL ELSE increment_by END AS increment_by,
CASE WHEN cycle_flag = 'N' THEN NULL ELSE cycle_flag END AS will_cycle,
CASE WHEN order_flag = 'N' THEN NULL ELSE order_flag END AS is_ordered,
LAST_NUMBER as START_VALUE,
CASE WHEN cache_size = 20 THEN NULL ELSE cache_size END AS cache_size
FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER = 'MVN_UAT'
[INFO] select OBJECT_NAME, CREATED, LAST_DDL_TIME AS LAST_MODIFIED, ALL_OBJECTS.STATUS, ALL_TRIGGERS.STATUS as TRIGGER_STATUS, trigger_body AS OBJECT_BODY, ACTION_TYPE, WHEN_CLAUSE, REFERENCING_NAMES, COLUMN_NAME, TABLE_NAME, BASE_OBJECT_TYPE, all_triggers.owner as TRIGGER_OWNER, TABLE_OWNER, TRIGGERING_EVENT, TRIGGER_TYPE, DESCRIPTION as TRIGGER_DESCRIPTION from ALL_OBJECTS join all_triggers on trigger_name=object_name and all_triggers.owner=all_objects.owner where object_type='TRIGGER' and all_triggers.owner='MVN_UAT'
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PROCEDURE' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='FUNCTION' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PACKAGE' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PACKAGE BODY' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] select OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME from DBA_DEPENDENCIES where REFERENCED_OWNER != 'SYS' AND NOT(NAME LIKE 'BIN$%') AND NOT(OWNER = REFERENCED_OWNER AND NAME = REFERENCED_NAME) AND (OWNER='MVN_UAT')
[INFO] DROP FUNCTION "MY_FUNCTION"
[INFO] DROP VIEW "NEW_VIEW"
[INFO] DROP TABLE "PERSON" CASCADE CONSTRAINTS
[INFO] DROP TABLE "DEPARTMENT" CASCADE CONSTRAINTS
[INFO] DROP TABLE "PERSON1" CASCADE CONSTRAINTS
[INFO] DROP TABLE "PERSON3" CASCADE CONSTRAINTS
[INFO] DROP TABLE "PERSON4" CASCADE CONSTRAINTS
[INFO] DROP TABLE "STATE" CASCADE CONSTRAINTS
[INFO] DROP TABLE "T_TABLE1000" CASCADE CONSTRAINTS
[INFO] DROP TABLE "T_TABLE79" CASCADE CONSTRAINTS
[INFO] DROP TABLE "table-test1" CASCADE CONSTRAINTS
[INFO] DROP TABLE "table-test2" CASCADE CONSTRAINTS
[INFO] DROP TABLE "table-test3" CASCADE CONSTRAINTS
[INFO] DROP PROCEDURE "PROCEDURE1"
[INFO] SELECT COUNT(*) FROM "DATABASECHANGELOG"
[INFO] SELECT OWNER, CONSTRAINT_NAME, TABLE_NAME, SEARCH_CONDITION, STATUS, VALIDATED FROM all_constraints WHERE constraint_type = 'C' AND SEARCH_CONDITION IS NOT NULL and owner='MVN_UAT'
[INFO] SELECT NULL AS SYNONYM_CATALOG_NAME, ALL_SYNONYMS.OWNER AS SYNONYM_SCHEMA_NAME, SYNONYM_NAME, NULL AS OBJECT_CATALOG_NAME, TABLE_OWNER AS OBJECT_SCHEMA_NAME, TABLE_NAME AS OBJECT_NAME, NULL AS OBJECT_TYPE FROM ALL_SYNONYMS WHERE (ALL_SYNONYMS.OWNER='MVN_UAT' OR (ALL_SYNONYMS.OWNER='PUBLIC' and ALL_SYNONYMS.TABLE_OWNER='MVN_UAT'))
[INFO] DROP TABLE "DATABASECHANGELOG"
[INFO] SELECT COUNT(*) FROM "DATABASECHANGELOGLOCK"
[INFO] SELECT OWNER, CONSTRAINT_NAME, TABLE_NAME, SEARCH_CONDITION, STATUS, VALIDATED FROM all_constraints WHERE constraint_type = 'C' AND SEARCH_CONDITION IS NOT NULL and owner='MVN_UAT'
[INFO] SELECT NULL AS SYNONYM_CATALOG_NAME, ALL_SYNONYMS.OWNER AS SYNONYM_SCHEMA_NAME, SYNONYM_NAME, NULL AS OBJECT_CATALOG_NAME, TABLE_OWNER AS OBJECT_SCHEMA_NAME, TABLE_NAME AS OBJECT_NAME, NULL AS OBJECT_TYPE FROM ALL_SYNONYMS WHERE (ALL_SYNONYMS.OWNER='MVN_UAT' OR (ALL_SYNONYMS.OWNER='PUBLIC' and ALL_SYNONYMS.TABLE_OWNER='MVN_UAT'))
[INFO] SELECT sequence_name,
CASE WHEN increment_by > 0
THEN CASE WHEN min_value=1 THEN NULL ELSE min_value END
ELSE CASE WHEN min_value=(-999999999999999999999999999) THEN NULL else min_value END
END AS min_value,
CASE WHEN increment_by > 0
THEN CASE WHEN max_value=999999999999999999999999999 THEN NULL ELSE max_value END
ELSE CASE WHEN max_value=last_number THEN NULL else max_value END
END AS max_value,
CASE WHEN increment_by = 1 THEN NULL ELSE increment_by END AS increment_by,
CASE WHEN cycle_flag = 'N' THEN NULL ELSE cycle_flag END AS will_cycle,
CASE WHEN order_flag = 'N' THEN NULL ELSE order_flag END AS is_ordered,
LAST_NUMBER as START_VALUE,
CASE WHEN cache_size = 20 THEN NULL ELSE cache_size END AS cache_size
FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER = 'MVN_UAT'
[INFO] select OBJECT_NAME, CREATED, LAST_DDL_TIME AS LAST_MODIFIED, ALL_OBJECTS.STATUS, ALL_TRIGGERS.STATUS as TRIGGER_STATUS, trigger_body AS OBJECT_BODY, ACTION_TYPE, WHEN_CLAUSE, REFERENCING_NAMES, COLUMN_NAME, TABLE_NAME, BASE_OBJECT_TYPE, all_triggers.owner as TRIGGER_OWNER, TABLE_OWNER, TRIGGERING_EVENT, TRIGGER_TYPE, DESCRIPTION as TRIGGER_DESCRIPTION from ALL_OBJECTS join all_triggers on trigger_name=object_name and all_triggers.owner=all_objects.owner where object_type='TRIGGER' and all_triggers.owner='MVN_UAT'
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PROCEDURE' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='FUNCTION' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PACKAGE' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] select OBJECT_NAME, STATUS, TEXT AS OBJECT_BODY from ALL_OBJECTS left outer join ALL_SOURCE on object_name=name and object_type=type and all_source.owner=all_objects.owner where object_type='PACKAGE BODY' and all_objects.owner='MVN_UAT' order by ALL_SOURCE.LINE
[INFO] DROP TABLE "DATABASECHANGELOGLOCK"
[INFO] Successfully deleted all supported object types in schema MVN_UAT.MVN_UAT.
[INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
[INFO] Successfully released change log lock
[INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:02 min
[INFO] Finished at: 2020-07-15T13:23:50-05:00
[INFO] ------------------------------------------------------------------------
dropAll
optional Maven configuration attributes
Attribute | Definition |
---|---|
liquibase.changelogCatalogName
|
Specifies the catalog Liquibase will use to create your changelog tables. |
liquibase.changelogSchemaName
|
Specifies the schema Liquibase will use to create your changelog tables. |
liquibase.clearCheckSums
|
Boolean. Forces checksums to be cleared from the DATABASECHANGELOG table. Default value is: false. |
liquibase.databaseChangeLogLockTableName
|
Specifies the table name to use for the DATABASECHANGELOGLOCK table. |
liquibase.databaseChangeLogTableName
|
Specifies the table name to use for the DATABASECHANGELOG table. |
liquibase.databaseClass
|
Specifies the database object class. |
liquibase.defaultCatalogName
|
Specifies the default catalog name to use for the database connection. |
liquibase.defaultSchemaName
|
Specifies the default schema name to use for the database connection. |
liquibase.driver
|
Specifies the driver class name to use for the database connection. |
driverPropertiesFile
|
Specifies the location of a JDBC connection properties file which contains properties the driver will use. |
liquibase.emptyPassword
|
Deprecated. Boolean. Use an empty or null value for the password instead. Default value is: false. |
expressionVariables
|
Specifies a map-based collection of changelog properties to apply. |
expressionVars
|
Specifies a property-based collection of changelog properties to apply. |
liquibase.includeArtifact
|
Boolean. Includes a Maven project artifact in the class loader, which obtains the Liquibase properties file and changelog files. Default value is |
liquibase.includeTestOutputDirectory
|
Boolean. Includes the Maven test output directory in the class loader which obtains the Liquibase properties file and changelog files. Default value is |
liquibase.licenseKey
|
Specifies your Liquibase Pro license key. |
liquibase.outputDefaultCatalog
|
Boolean. Specifies whether to ignore the catalog or database name. Default value is: false. |
liquibase.outputDefaultSchema
|
Boolean. Specifies whether to ignore the schema name. Default value is: false. |
liquibase.outputFileEncoding
|
Indicates that you want to set the character encoding of the output file during the |
liquibase.password
|
Specifies the database password for the database connection. |
liquibase.promptOnNonLocalDatabase
|
Deprecated. Boolean. Controls whether users are prompted before executing changesets to a non-local database. Default value is: true. |
liquibase.propertyFile
|
Specifies the Liquibase properties file to use for configuration, like |
liquibase.propertyFileWillOverride
|
Boolean. Indicates that you want the |
liquibase.propertyProviderClass
|
Specifies the property provider, which must be a |
liquibase.schemas
|
Specifies the schemas to be dropped. Comma-separated list. |
liquibase.server
|
Specifies the server ID in the Maven |
liquibase.skip
|
Boolean. Specifies whether to skip running Liquibase. The use of this attribute is not recommended but can be used when needed. Default value is: false. |
systemProperties
|
Specifies a list of system properties you want to pass to the database. |
liquibase.url
|
Specifies the database URL you want to use to execute Liquibase. |
liquibase.username
|
Specifies the database username for the database connection. |
liquibase.verbose
|
Boolean. Controls the amount of output detail when you call the plugin. Default value is: false. |