user2187935 user2187935 - 13 days ago 7
SQL Question

Update one row in the table, using liquibase

I was hoping if someone could verify if this is the correct syntax and correct way of populating the DB using liquibase? All, I want is to change value of a row in a table and I'm doing it like this:

<changeSet author="name" id="1231">
<update tableName="SomeTable">
<column name="Properties" value="1" />
<where>PROPERTYNAME = 'someNameOfThePropery"</where>
</update>
<changeSet>


All I want is to change one value in a row in some table. The above doesn't work, although application compiled and it didn't complain, but alas, the value wasn't changed.

Thank you

Answer

Yes it is possible. See the below syntax:

<changeSet author="name" id="1231">
    <update catalogName="dbname"
            schemaName="public"
            tableName="SomeTable">
        <column name="Properties" type="varchar(255)"/>
        <where>PROPERTYNAME = 'someNameOfThePropery'</where>
    </update>
</changeSet>

More info at Liquibase Update