sample-data: replacing pipes ('|') with newlines now via customChange
this avoids database-specific code spread over all sample-data/*.xml files
This commit is contained in:
@@ -16,26 +16,16 @@
|
||||
separator=";"
|
||||
tableName="asset">
|
||||
</loadData>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="20190502111400-2" author="mhoennig" context="sample-data,">
|
||||
|
||||
<!-- I've tried extracting this to a stored procedure, but a compatible call
|
||||
is only possible with PostgresSQL 11.x, otherwise the call syntax
|
||||
between H2 and PostgresSQL would be different which defeated the point.
|
||||
-->
|
||||
|
||||
<sql dbms="h2">
|
||||
UPDATE asset SET remark = replace(remark, '|', STRINGDECODE('\n'))
|
||||
</sql>
|
||||
|
||||
<sql dbms="postgresql">
|
||||
UPDATE asset SET remark = replace(remark, '|', E'\n')
|
||||
</sql>
|
||||
<customChange class="org.hostsharing.hsadminng.liquibase.ReplaceCustomChange">
|
||||
<param name="tableName" value="asset" />
|
||||
<param name="columnNames" value="remark" />
|
||||
<param name="searchFor" value="|" />
|
||||
<param name="replaceWith" value="\n" />
|
||||
</customChange>
|
||||
|
||||
<rollback>
|
||||
DELETE FROM asset;
|
||||
</rollback>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
Reference in New Issue
Block a user