how to insert html tag inside sql in Liquibase migration?

nightingale2k1 picture nightingale2k1 · Jul 4, 2009 · Viewed 11.1k times · Source

I need to update my data that have html tag inside so wrote this on liquibase

<sql> update table_something set table_content = " something <br/> in the next line " </sql>

it apparently doesn't work on liquibase ( i got loooong errors .. and meaningless). I tried to remove <br/> and it works.

my question is, is it possible to insert / update something that contains xml tag in Liquibase ?

I am using liquibase 1.9.3 with Grails 1.1.1

edited: forgot to set code sample tag in my examples.

Answer

Jorge Alves picture Jorge Alves · Jul 5, 2009

As the liquibase author mentions here you'll need to add CDATA section inside <sql>.

In your particular example that would become:

<sql><![CDATA[ update table_something set table_content = " something <br/> in the next line " ]]></sql>