use*_*935 17 sql database liquibase
我希望有人能够验证这是否是正确的语法和使用liquibase填充数据库的正确方法?所有,我想要更改表中的行的值,我这样做:
<changeSet author="name" id="1231">
<update tableName="SomeTable">
<column name="Properties" value="1" />
<where>PROPERTYNAME = 'someNameOfThePropery"</where>
</update>
<changeSet>
Run Code Online (Sandbox Code Playgroud)
我想要的是在一些表中连续更改一个值.上述方法不起作用,虽然应用程序编译后并没有抱怨,但唉,价值没有改变.
谢谢
Jav*_*den 56
上述答案过于复杂,大多数情况下这足够了:
<changeSet author="name" id="123">
<update tableName="SomeTable">
<column name="PropertyToSet" value="1" />
<where>otherProperty = 'otherPropertyValue'</where>
</update>
</changeSet>
Run Code Online (Sandbox Code Playgroud)
在WHERE子句中使用单引号而非双引号很重要.
Moh*_*eem -10
对的,这是可能的。请参阅以下语法:
<changeSet author="name" id="1231">
<update catalogName="dbname"
schemaName="public"
tableName="SomeTable">
<column name="Properties" type="varchar(255)"/>
<where>PROPERTYNAME = 'someNameOfThePropery'</where>
</update>
</changeSet>
Run Code Online (Sandbox Code Playgroud)
更多信息请参见Liquibase 更新
归档时间: |
|
查看次数: |
30540 次 |
最近记录: |