1
votes

I am having trouble with Liquibase. For some reason (i didn't change any existing changesets or something) it is attempts to apply changesets which is already in base. So i am getting the errors like "relation "table" already exists".

I found this tag - <validCheckSum>, but it seems that it is only for new checksums of changesets. What i want to do is to ignore some changeset if there is some checksum in databasechangelog. For example, i tried <validCheckSum>f24567a5f86276f22cb8c5a8eddf25a4</validCheckSum> but migration with this checksum (in table databasechangelog) still runs and fails.

UPD: If i run my changeset on empty database i can see that checksum did not changed. Still it tries to perform the migrations which is already complete one some non empty database.

1

1 Answers

1
votes

Checksum of the changeSet changes when your change the logic of your changeSet (everything besides preconditions, contexts, and validCheckSum). Check out this article What Affects ChangeSet Checksums?

You can execute liquibase:clearCheckSums command. It will recalculate the checksums of your changeSets and store their values in databasechangelog table, thus problem solving your problem.

You can use <validCheckSum>any</validCheckSum> if you don't want to deal with changing checksums in future, but it's not a good idea, since you're looking the integrity check for your changeSet.