简体   繁体   中英

ValidationFailedException after Liquibase update to 4.9.1

We were using older Liquibase that we now wanted to update to 4.9.1 due to vulnerabilities in older versions. However, now at least one of our old migrations fails with ValidationFailedException:

Invocation of init method failed; nested exception is liquibase.exception.ValidationFailedException: Validation Failed:
     1 changes have validation failures
          Postgresql requires constraintName on addPrimaryKey when clustered=true, config/liquibase/changelog/1580719313000-1.xml::1580719313000-1::xyz

The constraintName is missing from <addPrimaryKey> . However, it worked just fine with the older versions.

How can we fix this? If we change the migration, it changes its checksum and it will instead complain that there is a migration it doesn not know about.

You can update your changeset and add validCheckSum tag with the new value of the checksum. This way validation will pass, and changeset will still be deemed as executed on the existing databases. Check out thedocs from Liquibase.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM