Search code examples
liquibase

How to skip changelog on new databases?


I have a liquibase. Changelog with several changesets. All of them are already persisted to database. The bug in one of changesets is revealed. I want to skip this particular changeset(I cannot fix the bug because in order to fix it i need to create several new changesets(old one cannot be edited) )

How can i do it?


Solution

  • I'm not sure what exactly you're trying to achieve, but if you want a changeSet to be skipped, you can use <preConditions onFail="MARK_RAN"> and put the inside a condition that you know will fail. This way this particular changeset won't be executed, but all the others will.

    Also, already executed changesets can be edited (however, it's a bad practice to do so). You may edit it and add <validCheckSum>ANY (or a new check sum)</validCheckSum> at the beginning of changeSet.