I have a configuration that is written in xml and it works great, but I want to convert it to yaml format, but I get an error.
xml config
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
<changeSet id="send_service_entities" author="test">
<preConditions onFail="CONTINUE">
<changeLogPropertyDefined property="service.entities.migration.enabled" value="true"/>
</preConditions>
<comment>Sending service entities</comment>
<customChange class="com.testproject.migration.v2.ServiceEntitiesMigrationCustomChange">
<param name="serviceName" value="${spring.application.name}"/>
</customChange>
</changeSet>
</databaseChangeLog>
yaml config, liquibase seems to ignore "preConfition" and jump to the "changes" parameter
databaseChangeLog:
- changeSet:
id: send_service_entities
author: test
comment: "Sending service entities"
preConfition:
- onFail: CONTINUE
- changeLogPropertyDefined:
property: service.entities.migration.enabled
value: true
changes:
- customChange : {
"class": "com.testproject.migration.v2.ServiceEntitiesMigrationCustomChange",
"serviceName": "${spring.application.name}"
}
service.entities.migration.enabled in application.properties is false
You have a typo in
yamlchangeSet:preConfitioninstead ofpreConditionsCheck out
yamlexample for preConditions: