Remik
Remik

Reputation: 85

LiquiBase ValidationFailedException. Checksum changed without reason

I've got some changelog files and when i try to generate sql files for them i get: ValidationFailedException.

Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
     13 change sets check sum
          db-changelogs/test1.xml::test-1::rw is now: 7:d41d8cd98f00b204e9800998ecf8427e

The problem is i haven't made any changes in these files. My collegues work on the same git branch and it works perfectly for them.

I've checked textCoding and some other things but it still doesnt work. I run it with ant script.

My database-changelog (new-db-changelog.xml):

<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
    http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

    <include file="db-changelogs/testl.xml"/>

</databaseChangeLog>

Change log (test1.xml):

<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
    http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

        <changeSet id="test-1" author="rem" >
            <ext:sqlWrapper context="common-schema">
                <![CDATA[
    CREATE TABLE common.test(
      id bigint NOT NULL,
      "name" character varying,
      CONSTRAINT test_lb_pkey PRIMARY KEY (id)
    );
                ]]>
            </ext:sqlWrapper>
        </changeSet>

    </databaseChangeLog>

Upvotes: 4

Views: 7467

Answers (2)

大文茫
大文茫

Reputation: 31

Add attribute runOnChange="true"

<changeSet id="test-1" author="rem" runOnChange="true">

Upvotes: 3

Christian Karlsson
Christian Karlsson

Reputation: 101

We just discovered that 3.1.1 seems to make a difference in whitespaces when calculating checksums. We have some changes with pure SQL that I happened to reformat from spaces to tabs and the checksums got changed.

Could this be the case perhaps?

Upvotes: 1

Related Questions