V4.0.0 changeset with update tableName="table" where

Hi,

We’re in the process of upgrading from Liquibase 3.6.3 to 4.0.0 and I had everything working ok with V4.0.0 but using the 3.9 xsd in our xml changeset files because the 4.0 xsd wasn’t available yet. @ronak informed me that the 4.0 xsd is now available, so I’ve changed all of our xml files to use the 4.0 xsd (we obviously want to make sure everything matches up with the correct versions), but doing this has broken one of our changesets :cry:

The changeset has update statements similar to this:

<update tableName="TABLE" where="ID=2">
    <column name="ICON" defaultValue="null" valueBlobFile="images/icons/icon1.svg"/
</update>

Basically we’re using this to populate images into the table that our front end needs access to (we’re using this to provide customizable icons for different customers).

With the 4.0 xsd Liquibase is now complaining about the where part of the above statement. Its saying “Attribute where is not allowed here”

I’ve checked to see what changes there are between the 3.9 xsd and the 4.0 xsd and there doesn’t seem to be any changes related to the where element, so I’m not sure why this is happening.

Does anyone have any ideas how to fix this?

Cheers,
Dave

So, I’ve managed to figure this one out! :slight_smile:

Basically I had to change the update statement to this format:

<update tableName="TABLE">
    <column name="ICON" defaultValue="null" valueBlobFile="images/icons/icon1.svg"/>
    <where>ID=2</where>
</update>

It seems like this must have been a change that came in somewhere between 3.6.3 and 3.9 (since there were no changes between 3.9 and 4.0 regarding the where element) so I don’t really know why the 3.9 xsd was happy with the way I had the statement formatted before.

Anyway, our upgrade to V4.0.0 is now finally all working and happy, so I’m happy too :smiley:

2 Likes

Woo-hoo @devdave! You figured it out on your own AND shared back with the community. Thank you so much!

1 Like