简体   繁体   English

在 liquibase 默认值字段中添加与号

[英]Adding ampersand in liquibase default value field

I need add a default value for a column in liquibase changeset.我需要为 liquibase 变更集中的列添加默认值。

<changeSet id="1">
        <insert tableName="table_name">
            <column name="column_name" value="value1 & value2"/>
        </insert>
</changeSet>

Since liquibase treats ampersand '&' as special character, it marks it as an error.由于 liquibase 将&符号“&”视为特殊字符,因此将其标记为错误。 What is the escape character for & in liquibase? liquibase 中 & 的转义字符是什么?

Realised the escape character would be same as the one used in any other XML based document since liquibase is XML based.意识到转义字符将与任何其他基于 XML 的文档中使用的相同,因为 liquibase 是基于 XML 的。

ie the escape character is &amp;即转义字符是&amp;

Reference - stackoverflow.com/questions/12524908/how-to-escape-in-xml参考 - stackoverflow.com/questions/12524908/how-to-escape-in​​-xml

PS answering my own question but feel it would be useful for others looking for the same info. PS回答我自己的问题,但觉得这对寻找相同信息的其他人很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM