calculate-checksum
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 Changeset Checksums.
Syntax
To run the calculate-checksum
command, specify the driver, classpath, and URL in the Liquibase properties file or in your command line. For more information, see Create and Configure a liquibase.properties File.
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
.
Command parameters
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Author of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
ID of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: In 4.25.0+, you can either specify |
Optional |
|
Path of the changelog that contains the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
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 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 |
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Author of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
ID of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: In 4.25.0+, you can either specify |
Optional |
|
Path of the changelog that contains the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
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 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 |
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Author of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
ID of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: In 4.25.0+, you can either specify |
Optional |
|
Path of the changelog that contains the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
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 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 |
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Author of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
ID of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: In 4.25.0+, you can either specify |
Optional |
|
Path of the changelog that contains the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
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 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 |
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL. See Using JDBC URL in Liquibase. |
Required |
|
Author of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
ID of the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Tag defined as a number or a descriptive name that is unique to each changeset. Requires the following format: In 4.25.0+, you can either specify |
Optional |
|
Path of the changelog that contains the changeset. Available in Liquibase 4.25.0+. Cannot be used with |
Optional |
|
Name of the default catalog to use for the database connection |
Optional |
|
Name of the default schema to use for the database connection. If Tip: In Liquibase v4.23.0+, camelCase for Note: The syntax |
Optional |
|
The JDBC driver class |
Optional |
|
The JDBC driver properties file |
Optional |
|
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 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 |
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.
Output
8:42b8af7ffb26b44a2716b330d78b90d5
Liquibase command 'calculate-checksum' was executed successfully.