calculateCheckSum command

Nathan, in my Liquibase fork I’ve implemented a calculateCheckSum command for the command line integration.  You feed it a --changeLogFile=changelog.xml option and a changeSet id in the form filename::id::author.  It prints (to System.out) the checksum for that changeSet as computed from the XML file.  A sample invocation follows:

liquibase --changeLogFile=changelog.xml someLogicalFilePathHere::foo.tableCreation::lnelson

I will check this into my fork shortly.

Afterwards, shall I send you a pull request, or would you prefer a patch?


In the absence of any feedback, I sent a pull request.

Hi Ijnelson,

thanks for adding this function.

It was needed to calculate some hashes without any interactions of db.

Some questions:

  • Why I had to add --changeLogFile? additionaly to the “someLogicalFilePathHere” in the part of the id?
  • Why I had to add the --url, --username and --password?

So only this command works:

  1. java -jar $LIQUIBASE_HOME/liquibase.jar --logLevel=debug --changeLogFile=ABSOLUTE_PATH_TO_PROJECT/database/liquibase/main-changelog.xml --driver=com.mysql.jdbc.Driver --classpath=$LIQUIBASE_HOME/lib/mysql-connector-java-5.1.15.jar --url=“jdbc:mysql://” --username=user  --password=pass calculateCheckSum ABSOLUTE_PATH_TO_PROJECT/database/liquibase/2.46.0/changelog.xml::v2.46.0_1::theAuthor

I did not cloned the git repo and checked the complete method but in my view it is not needed to add the url, username und password.