Maven rollback

Note: There are differences in how rollback works with Maven vs. how it works from the CLI

liquibase:rollback

Full name:

org.liquibase:liquibase-maven-plugin:3.8.8:rollback

Description:

Invokes Liquibase to rollback the database (and mark changesets as unapplied). The changesets to be rolled back are specified using attributes 'rollbackCount', 'rollbackTag' and/or 'rollbackDate'.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: test.

Optional Parameters

Name Type Since Description
liquibase.changeLogDirectory String - Specifies the directory where Liquibase can find your changelog file.
liquibase.changeLogFile String - Specifies the changelog file for Liquibase to use.
liquibase.changelogCatalogName String - Specifies the catalog Liquibase will use to create your changelog tables.
liquibase.changelogSchemaName String - Specifies the schema Liquibase will use to create your changelog table.
liquibase.clearCheckSums boolean - A flag that forces checksums to be cleared from the DATABASECHANGELOG table.
Default value is: false.
liquibase.contexts String - Specifies which contexts Liquibase will execute, which can be separated by a comma if multiple contexts are required. If a context is not specified, then ALL contexts will be executed.
liquibase.databaseChangeLogLockTableName String - Specifies the table name to use for the DATABASECHANGELOGLOCK table.
liquibase.databaseChangeLogTableName String - Specifies the table name to use for the DATABASECHANGELOG table.
liquibase.databaseClass String - Specifies the database object class.
liquibase.defaultCatalogName String - Specifies the default catalog name to use for the database connection.
liquibase.defaultSchemaName String - Specifies the default schema name to use for the database connection.
liquibase.driver String - Specifies the driver class name to use for the database connection.
driverPropertiesFile File - Specifies the location of a JDBC connection-properties file which contains properties the driver will use.
liquibase.emptyPassword boolean - Deprecated. Use an empty or null value for the password instead.
Default value is: false.
expressionVariables Map - A map-based collection of changelog properties to apply.
expressionVars Properties - 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 and changelog files.
Default value is: true.
liquibase.includeTestOutputDirectory boolean - Includes the Maven test output directory in the class loader which obtains the liquibase.properties and changelog files.
Default value is: true.
liquibase.labels String - Specifies which Liquibase labels Liquibase will execute, which can be separated by a comma if multiple labels are required or you need to designate a more complex expression. If a label is not specified, then ALL labels will be executed.
liquibase.liquibaseProLicenseKey String - Specifies your Liquibase Pro license key.
liquibase.logging String - Controls the amount of logging detail Liquibase outputs when executing. The values can be "DEBUG", "INFO", "WARNING", "SEVERE", or "OFF". The value is not case sensitive.
Default value is: INFO.
liquibase.outputDefaultCatalog boolean - Specifies whether to ignore the catalog/database name.
Default value is: false.
liquibase.outputDefaultSchema boolean - Specifies whether to ignore the schema name.
Default value is: false.
liquibase.outputFileEncoding String - A flag which indicates you want to set the character encoding of the output file during the updateSQL phase.
liquibase.password String - Specifies the database password for database connection.
liquibase.promptOnNonLocalDatabase boolean - Controls whether users are prompted before executing changesets to a non-local database.
Default value is: true.
liquibase.propertyFile String - Specifies the liquibase.properties you want to use to configure Liquibase.
liquibase.propertyFileWillOverride boolean - A flag which indicates you want the liquibase.properties file to override any settings provided in the Maven plugin configuration. By default, if a property is explicitly specified it is not overridden if it also appears in the properties file.
Default value is: false.
liquibase.propertyProviderClass String - Specifies the property provider which must be a java.util.Properties implementation.
liquibase.rollbackCount int - The number of change sets to rollback.
Default value is: -1.
liquibase.rollbackDate String - The date to rollback the database to. The format of the date must match either an ISO date format, or that of the DateFormat.getDateInstance() for the platform the plugin is executing on.
liquibase.rollbackTag String - The tag to roll the database back to.
liquibase.server String - Specifies the server ID in the Maven settings.xml to use when authenticating.
liquibase.skip boolean - Specifies whether to skip running Liquibase. The use of this parameter is NOT RECOMMENDED but can be used when needed.
Default value is: false.
systemProperties Properties - Specifies a list of system properties you want to pass to the database.
liquibase.url String - Specifies the database URL you want to use to execute Liquibase.
liquibase.username String - Specifies the database username for database connection.
liquibase.verbose boolean - Controls the amount of output detail when you call the plugin.
Default value is: false.

Parameter Details

liquibase.changeLogDirectory:

Specifies the directory where Liquibase can find your changelog file.
  • Type: java.lang.String
  • Required: No

liquibase.changeLogFile:

Specifies the changelog file for Liquibase to use.
  • Type: java.lang.String
  • Required: No

liquibase.changelogCatalogName:

Specifies the schema Liquibase will use to create your changelog tables.
  • Type: java.lang.String
  • Required: No

liquibase.changelogSchemaName:

Specifies the schema Liquibase will use to create your changelog table.
  • Type: java.lang.String
  • Required: No

liquibase.clearCheckSums:

A flag that forces checksums to be cleared from the DATABASECHANGELOG table.
  • Type: boolean
  • Required: No
  • Default: false

liquibase.contexts:

Specifies which contexts Liquibase will execute, which can be separated by a comma if multiple contexts are required. If a context is not specified, then ALL contexts will be executed.
  • Type: java.lang.String
  • Required: No

liquibase.databaseChangeLogLockTableName:

Specifies the table name to use for the DATABASECHANGELOGLOCK table.
  • Type: java.lang.String
  • Required: No

liquibase.databaseChangeLogTableName:

Specifies the table name to use for the DATABASECHANGELOG table.
  • Type: java.lang.String
  • Required: No

liquibase.databaseClass:

Specifies the database object class.
  • Type: java.lang.String
  • Required: No

liquibase.defaultCatalogName:

Specifies the default catalog name to use for the database connection.
  • Type: java.lang.String
  • Required: No

liquibase.defaultSchemaName:

Specifies the default schema name to use for the database connection.
  • Type: java.lang.String
  • Required: No

liquibase.driver:

Specifies the driver class name to use for the database connection.
  • Type: java.lang.String
  • Required: No

driverPropertiesFile:

Specifies the location of a JDBC connection-properties file which contains properties the driver will use.
  • Type: java.io.File
  • Required: No

liquibase.emptyPassword:

Deprecated. Use an empty or null value for the password instead.
Use an empty string as the password for the database connection. This should not be used along side the password setting.
  • Type: boolean
  • Required: No
  • Default: false

expressionVariables:

A map-based collection of changelog properties to apply.
  • Type: java.util.Map
  • Required: No

expressionVars:

A property-based collection of changelog properties to apply.
  • Type: java.util.Properties
  • Required: No

liquibase.includeArtifact:

Includes a Maven project artifact in the class loader which obtains the liquibase.properties and changelog files.
  • Type: boolean
  • Required: No
  • Default: true

liquibase.includeTestOutputDirectory:

Includes the Maven test output directory in the class loader which obtains the liquibase.properties and changelog files.
  • Type: boolean
  • Required: No
  • Default: true

liquibase.labels:

Specifies which Liquibase labels Liquibase will execute, which can be separated by a comma if multiple labels are required or you need to designate a more complex expression. If a label is not specified, then ALL labels will be executed.
  • Type: java.lang.String
  • Required: No

liquibase.liquibaseProLicenseKey:

Specifies your Liquibase Pro license key.
  • Type: java.lang.String
  • Required: No

liquibase.logging:

Controls the amount of logging detail Liquibase outputs when executing. The values can be "DEBUG", "INFO", "WARNING", "SEVERE", or "OFF". The value is not case sensitive.
  • Type: java.lang.String
  • Required: No
  • Default: INFO

liquibase.outputDefaultCatalog:

Specifies whether to ignore the catalog/database name.
  • Type: boolean
  • Required: No
  • Default: false

liquibase.outputDefaultSchema:

Specifies whether to ignore the schema name.
  • Type: boolean
  • Required: No
  • Default: false

liquibase.outputFileEncoding:

A flag which indicates you want to set the character encoding of the output file during the updateSQL phase.
  • Type: java.lang.String
  • Required: No

liquibase.password:

Specifies the database password for database connection.
  • Type: java.lang.String
  • Required: No

liquibase.promptOnNonLocalDatabase:

Controls whether users are prompted before executing changesets to a non-local database.
  • Type: boolean
  • Required: No
  • Default: true

liquibase.propertyFile:

Specifies the liquibase.properties you want to use to configure Liquibase.
  • Type: java.lang.String
  • Required: No

liquibase.propertyFileWillOverride:

A flag which indicates you want the liquibase.properties file to override any settings provided in the Maven plugin configuration. By default, if a property is explicitly specified it is not overridden if it also appears in the properties file.
  • Type: boolean
  • Required: No
  • Default: false

liquibase.propertyProviderClass:

Specifies the property provider which must be a java.util.Properties implementation.
  • Type: java.lang.String
  • Required: No

liquibase.rollbackCount:

The number of changesets to rollback.
  • Type: int
  • Required: No
  • Default: -1

liquibase.rollbackDate:

The date to rollback the database to. The format of the date must match either an ISO date format, or that of the DateFormat.getDateInstance() for the platform the plugin is executing on.
  • Type: java.lang.String
  • Required: No

liquibase.rollbackTag:

The tag to roll the database back to.
  • Type: java.lang.String
  • Required: No

liquibase.server:

Specifies the server ID in the Maven settings.xml to use when authenticating.
  • Type: java.lang.String
  • Required: No

liquibase.skip:

Specifies whether to skip running Liquibase. The use of this parameter is NOT RECOMMENDED but can be used when needed.
  • Type: boolean
  • Required: No
  • Default: false

systemProperties:

Specifies a list of system properties you want to pass to the database.
  • Type: java.util.Properties
  • Required: No

liquibase.url:

Specifies the database URL you want to use to execute Liquibase.
  • Type: java.lang.String
  • Required: No

liquibase.username:

Specifies the database username for database connection.
  • Type: java.lang.String
  • Required: No

liquibase.verbose:

Controls the amount of output detail when you call the plugin.
  • Type: boolean
  • Required: No
  • Default: false


Differences in Controlling Rollback Behavior

Behavior CLI Command Maven
rollback by count rollbackCount 3 rollback goal, liquibase.rollbackCount=3 property
rollback by tag rollback rollback goal, liquibase.rollbackTag and liquibase.tag properties
rollback to date rollbackToDate <date/time> rollback goal, liquibase.rollbackDate property