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
Running the update Change Type To update a table for your database, follow these steps: Step 1: Add the update Change Type to your changeset with the needed attributes as it is shown in the examples. Step 2: Deploy your changeset by running the update command. Now, you should see an updated table.
The changeset tag is a unit of change that Liquibase executes on a database and which is used to group database Liquibase Change Types together. A list of changes created by multiple changesets are tracked in a changelog.
The above answers are overly complicated, for most cases this is enough:
<changeSet author="name" id="123"> <update tableName="SomeTable"> <column name="PropertyToSet" value="1" /> <where>otherProperty = 'otherPropertyValue'</where> </update> </changeSet>
important to use single quotes ' and not double quotes " in the WHERE clause.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With