Maven rollbackOneChangeSetSQL

Last updated: July 14, 2025

The Maven rollbackOneChangeSetSQL goal is a helper goal that allows you to inspect the SQL Liquibase will run to revert the changeset specified when using the Maven rollbackOneChangeSet goal.

Note: This is a Liquibase Pro goal, so you need a Liquibase Pro license key to use it.

Uses

The Maven rollbackOneChangeSetSQL goal is typically used when you want to inspect the raw SQL that Liquibase uses to revert your changeset when you run the rollbackOneChangeSet goal so that you don't unintentionally make a mistake.

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. To learn about each file's syntax, see Maven Properties.

Tip: For more information about the Maven configuration, see Configuring Maven.

Ensure you add <ProLicenseKey>specify your Liquibase Pro license key here</ProLicenseKey> to pom.xml or specify it in another valid way.

Running the rollbackOneChangeSetSQL Maven goal

Before running the rollbackOneChangeSetSQL goal, gather the following information from your DATABASECHANGELOG table:

  • The author of the changeset you want to revert.

  • The id of the changeset you want to revert.

  • The filename (changeset path) of the changeset you want to revert.

Note: The liquibase.rollbackScript script is only needed if the rollback is not yet defined in the changelog, and if it is not a rollback that is automatically provided by Liquibase.

Also, you can run the Maven history goal to see the history of all deployments against the configured database:

mvn liquibase:history

Next, run the rollbackOneChangeSetSQL goal, with your information:

Note: Running the rollbackOneChangeSetSQL goal requires a Maven project to be implemented.

mvn liquibase:rollbackOneChangeSetSQL -Dliquibase.changeSetAuthor="LiquibaseProUser" -Dliquibase.changeSetId="createProSchema" -Dliquibase.changeSetPath="changelog.xml" -Dliquibase.force

Note: Enter the name of the changeset author, id, and the path with the changelog filename that you want to use in place of LiquibaseProUser, createProSchema, and changelog.xml. For more information, run mvn liquibase:help -Ddetail=true -Dgoal=rollbackOneChangeSetSQL.

Maven rollbackOneChangeSetSQL

Required Maven rollbackOneChangeSetSQL configuration attributes

Definition

liquibase.changeSetAuthor

Specifies the author of the changeset you want to roll back.

liquibase.changeSetId

Specifies the changeset Id to roll back.

liquibase.changeSetPath

Specifies the path to the changelog, which contains the changeset you want to roll back.

liquibase.force

Specifies a required flag that indicates you intend to run this command.

liquibase.licenseKey

Specifies your Liquibase Pro license key.

Maven rollbackOneChangeSetSQL output

Starting Liquibase at 10:24:59 (version 4.1.1 #10 built at 2020-10-12 19:24+0000) [INFO] Parsing Liquibase Properties File local.liquibase.properties for changeLog parameters [INFO] Executing on Database: jdbc:oracle:thin:@localhost:1521/ORCL [INFO] Successfully installed license from Base64 string starting with 'ABwwGgQUvH' (property liquibaseProLicenseKey). [INFO] Liquibase Pro 4.1.1 by Liquibase licensed to support until Wed Sep 22 23:59:59 CDT 2021 [INFO] Liquibase Pro 4.1.1 by Liquibase licensed to support until Wed Sep 22 23:59:59 CDT 2021 [INFO] Successfully acquired change log lock [INFO] Reading from DATABASECHANGELOG [INFO] Successfully released change log lock -- Lock Database UPDATE DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'WIN-20E107KB4TN (172.30.3.88)', LOCKGRANTED = TO_TIMESTAMP('2020-11-27 10:25:01.185', 'YYYY-MM-DD HH24:MI:SS.FF') WHERE ID = 1 AND LOCKED = 0; -- ********************************************************************* --rollback changeset 'dbchangelog.xml::createProSchema::LiquibaseProUser' -- ********************************************************************* -- Change Log: dbchangelog.xml -- Ran at: 11/27/20 10:25 AM -- Against: MVN_UAT@jdbc:oracle:thin:@localhost:1521/ORCL -- Liquibase version: 4.1.1 -- ********************************************************************* -- Rolling Back ChangeSet: dbchangelog.xml::createProSchema:: LiquibaseProUser DROP TABLE 2; DELETE FROM DATABASECHANGELOG WHERE ID = 'createProSchema' AND AUTHOR = 'LiquibaseProUser' AND FILENAME = 'dbchangelog.xml'; -- Release Database Lock UPDATE DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1; [INFO] ------------------------------------------------------------------------ [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.917 s [INFO] Finished at: 2020-11-27T10:25:01-06:00 [INFO] ------------------------------------------------------------------------

Maven rollbackOneChangeSetSQL - Liquibase