Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you clear liquibase checksums for a given file only?

Tags:

liquibase

Running

liquibase --url=jdbc:oracle:thin:@localhost:1521/XE --    
driver=oracle.jdbc.OracleDriver --changeLogFile=db.changelog-next.xml --    
username=owner --password=xxxx --logLevel=info clearCheckSums

clears ALL checksums from the database. Is there a way to clear only the checksums for changesets in db.changelog-next.xml.

Thanks

like image 258
Lionel Orellana Avatar asked May 27 '15 02:05

Lionel Orellana


People also ask

How do you run a Liquibase clear checksum?

To run the clear-checksums command, specify the database driver, classpath, and URL the Liquibase properties file. For more information, see Specifying Properties in a Connection Profile. You can also specify these properties in your command line.

How does Liquibase calculate checksum?

When running the calculate-checksum command, the DATABASECHANGELOG table calculates an MD5 checksum for each entry based on the SQL script of the changeset. This checksum helps Liquibase detect differences between the changesets you want to deploy and the changesets that have already been run against the database.

Where are Liquibase checksums?

In order to detect changes between what is currently in the changelog vs. what was actually run against the database, Liquibase stores a checksum with each changeset entry in the DATABASECHANGELOG tracking table.


1 Answers

I don't think there is another command or a parameter to clearCheckSums that does this.

But you could do this manually. All that clearCheckSums does is nullifying the MD5SUM column of the databasechangelog table.

So something like:

update databasechangelog set md5sum=null where filename like '%db.changelog-next.xml';

should work.

(I haven't tested this SQL. It's just an example - so before you apply this to your production database make sure this works on a development db.)

like image 171
Jens Avatar answered Sep 22 '22 22:09

Jens