Adding ampersand in liquibase default value field

6.3k Views Asked by At

I need add a default value for a column in liquibase changeset.

<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. What is the escape character for & in liquibase?

1

There are 1 best solutions below

0
Anand Mattikopp On BEST ANSWER

Realised the escape character would be same as the one used in any other XML based document since liquibase is XML based.

i.e the escape character is &amp;

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

P.S answering my own question but feel it would be useful for others looking for the same info.