nig*_*2k1 13 database migration grails liquibase
我需要更新我的内部有html标签的数据,所以在liquibase上写了这个
<sql> update table_something set table_content = " something <br/> in the next line " </sql>
Run Code Online (Sandbox Code Playgroud)
它显然不适用于liquibase(我得到了loooong错误......并且毫无意义).我试图删除<br/>,它的工作原理.
我的问题是,是否可以在Liquibase中插入/更新包含xml标签的内容?
我使用liquibase 1.9.3和Grails 1.1.1
编辑:忘了在我的例子中设置代码示例标记.
Jor*_*ves 18
正如liquibase作者在这里提到的,你需要在<sql>中添加CDATA部分.
在您的特定示例中,将成为:
<sql><![CDATA[ update table_something set table_content = " something <br/> in the next line " ]]></sql>
Run Code Online (Sandbox Code Playgroud)
小智 7
最好不要使用<sql>标签(我添加了where子句......):
<changeSet author="author" id="table_something_1">
<update tableName="table_something">
<column name="table_content"><![CDATA[ something <br/> in the next line ]]></column>
<where>id=1</where>
</update>
<rollback />
</changeSet>
Run Code Online (Sandbox Code Playgroud)