calculate-checksum

Last published July 28, 2025

The calculate-checksum command calculates and prints a checksum for a changeset in your changelog.

Uses

The calculate-checksum 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.

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.

For more information, see What is a changeset checksum?

Syntax

To run the calculate-checksum command, specify the driver, classpath, and URL in the Liquibase properties file or in your command line.

When you run calculate-checksum, you must identify which changeset to target by specifying its filepath, ID, and author in the following format: filepath::id::author. The filepath refers to the path from the current working directory to the changelog that your changeset is in. For example:

liquibase calculate-checksum --changeset-identifier=com/example/example-changelog.xml::1::adrian

If you want to run this command on a changeset that uses the logicalFilePath attribute, specify the logical filepath instead.

Note: In Liquibase 4.25.0 and later, you can instead specify the changeset identifier with the individual attributes --changeset-author, --changeset-id, and --changeset-path.

Note: The --changeset-identifier=value syntax was added in Liquibase 4.4. If you use an older version, specify your identifier as a positional argument: <command> value.

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.

Command parameters

Attribute

Definition

Requirement

--changelog-file=<string>

The root changelog

Required

--url=<string>

The JDBC database connection URL.

Required

--changeset-author=<string>

Liquibase 4.25.0+. Author of the changeset. Cannot be used with --changeset-identifier.

Optional

--changeset-id=<string>

Liquibase 4.25.0+. ID of the changeset. Cannot be used with --changeset-identifier.

Optional

--changeset-identifier=<string>

Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: filepath::id::author. Specify as --changeset-identifier=value. Positional format <command> <value> deprecated in 4.4+.

In 4.25.0+, you can either specify --changeset-identifier in the filepath::id::author format or specify --changeset-author, --changeset-id, and --changeset-path individually. However, you cannot specify a changeset in both ways.

Optional

--changeset-path=<string>

Liquibase 4.25.0+. Path of the changelog that contains the changeset. Cannot be used with --changeset-identifier.

The path to the changelog containing the changeset you want to target. For example, you may have a root changelog (root.sql) and a child changelog (child.sql). To target a specific changeset in child.sql, specify --changeset-path=child.sql.

If root.sql uses include, includeAll, or sqlFile to reference child.sql, you must also specify --changelog-file=root.sql (file and path are different).

If root.sql does not reference child.sql, you must also specify --changelog-file=child.sql (file and path are the same).

If you only have one changelog, then --changelog-file and --changeset-path must also be the same.

Optional

--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.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

--driver=<string>

The JDBC driver class

Optional

--driver-properties-file=<string>

The JDBC driver properties file

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

--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

Output

8:42b8af7ffb26b44a2716b330d78b90d5 Liquibase command 'calculate-checksum' was executed successfully.

calculate-checksum - Liquibase