calculateCheckSum <id> command

The calculateCheckSum <id> command calculates and prints a checksum for the changeset with the specified id in the following format: filepath::id::author.

Uses

The calculateCheckSum <id> command is typically used to compute an MD5 checksum, which serves as a unique identifier for the changeset. As a result, you can see whether the changeset has been changed and whether it has to be deployed differently now.

When running the calculateCheckSum <id> command, the DATABASECHANGELOG table calculates an MD5 checksum for each entry based on the SQL script of the changeset. This checksum helps Liquibase detect differences between the changesets you want to deploy and the changesets that have already been run against the database.

The MD5SUM column in the DATABASECHANGELOG table contains a checksum of the changeset and any change made in the changeset will result in a different checksum.

Running the calculateCheckSum <id> command

To run the calculateCheckSum <id> command, you can specify the driver, classpath, and URL in your liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these properties in your command line.

Then run the calculateCheckSum <id> command:

liquibase calculateCheckSum changelog.oracle.sql::myID_123::Steve

Note: Enter the name of your changelog, id, and author name that you want to use in place of changelog.oracle.sql, myID_123, and Steve. If you use the .sql file, include your database type in place of oracle.

calculateCheckSum <id> global attributes

Attribute Definition Requirement

--changeLogFile

The root changelog

Required

--url

The JDBC database connection URL

Required

--username*

The database username

Required*

--password*

The database password

Required*

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication.

calculateCheckSum <id> command attributes

Attribute Definition Requirement

<id>

Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format for the calculateCheckSum <id> command: filepath::id::author.

Required

calculateCheckSum example output

Liquibase Pro 3.9.0 by Datical licensed to Liquibase Pro Customer until Tue Sep 22 19:00:00 CDT 2020
8:42b8af7ffb26b44a2716b330d78b90d5
Liquibase command 'calculateCheckSum' was executed successfully.