Understanding validCheckSum

OK, I have confirmed that my interpretation—not the manual—is correct.

If it is OK with everyone I will update the manual to read:

Specifies that should Liquibase’s calculation of the Since 1.7

Best,
Laird

I think I have a fundamental misunderstanding of the http://about.me/lairdnelson

Oops; don’t have the privileges to update the wiki; filed https://liquibase.jira.com/browse/CORE-1112 to track it instead.


http://about.me/lairdnelson

Yeah, I locked down the wiki after a previous spam attack. I’ll get the docs fixed, thanks for the jira entry.


Nathan

This means you can’t use to mitigate problems when migrating from one Liquibase version to another.  For example:

  • I apply a changeSet to the DB using Liquibase v1.0, and it generates a hash of X.
  • I don’t change the original changeSet, but I update to Liquibase v1.1.  Now my changeSet has a hash of Y, and liquibase won’t apply any further changeSets.
  • I add Y to the changeSet to control this - telling Liquibase the hash in DATABASECHANGELOG is actually Y not X.  I can continue my migration with Liquibase 1.1.
  • Now I update to Liquibase 1.2.  The hash of my original changeSet is recomputed as Z.  I have to change my existing changeSet to Z.


And, since validCheckSum is a child tag of a changeSet, simply adding the tag causes the checksum to change.  To build on your example,

  • My changeSet has a hash of X.
  • I update Liquibase, so now my changeSet has a hash of Y.
  • I add Y to the changeset, but now the checksum is Z because I’ve changed the changeSet.

I’m wondering if I’m just misunderstanding the use of the validCheckSum tag…

The validCheckSum tag is not included in the checksum computation, so it should not change by adding the tag.


Nathan

Glad you figured it out. Thanks for the update.


Nathan

I stand corrected.  When I was playing with valid checksums in version 3.0.7, I was getting behavior that seemed to indicate that the checksum was changing whenever I adding/modified the validCheckSum tag, but it all seems to be working correctly in version 3.1.1.

 

Sorry for the confusion,

 

Steve

This is STILL wrong in the manual…

http://www.liquibase.org/documentation/changeset.html

When comparing the changeSet stored in the database with the checksum generated from the current changeSet, do not consider the changeSet changed if the given validCheckSum is in the database.

Thanks for reminding me. I updated the docs, let me know what you think.

Nathan