Hello all!
I am currently trying to add a customized liquibase camunda-changelog.xml script to my Camunda Run 7 pod on Kubernetes.
Because the camunda-changelog.xml file is available in the container by default in the camunda/configuration/sql/liquibase folder, I assumed that placing a customized version of the camunda-changelog.xml at this location during deployment via an init-container (before startup of the application) would lead to customized database entries in the Postgres database tables.
This is not the case. After deployment of my application I find the customized camunda-changelog.xml under camunda/configuration/sql/camunda-changelog.xml, but I do not find my tables in Postgres altered compared to the default camunda-changelog.xml script.
In addition added the following variable to production.yml without postive results:
spring.liquibase.change-log: file:camunda/configuration/sql/liquibase/camunda-changelog.xml
Is there anyone who has done this using Camunda Run 7? Is this the right approach or am I missing information?
reproduction:
- create a liquibase script consisting out of a small alteration to camunda-changelog.xml
- place this in a pod at camunda/configuration/sql/liquibase/camunda-changelog.xml using an init container
- also try to add spring.liquibase.change-log: file:camunda/configuration/sql/liquibase/camunda-changelog.xml - I tried both with and without this step
- observe that my altered version of the camunda-changelog is available at the location of step 2 (original file is overwritten)
- observe that the database table is NOT overwritten.
Camunda-changelog.xml:
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<property name="db.name" value="db2" dbms="db2"/>
<property name="db.name" value="h2" dbms="h2"/>
<property name="db.name" value="mariadb" dbms="mariadb"/>
<property name="db.name" value="mssql" dbms="mssql"/>
<property name="db.name" value="mysql" dbms="mysql"/>
<property name="db.name" value="oracle" dbms="oracle"/>
<property name="db.name" value="postgres" dbms="postgresql"/>
<changeSet author="Camunda" id="7.16.0-baseline">
<sqlFile path="baseline/liquibase.${db.name}.create.engine.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.history.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.identity.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.case.engine.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.case.history.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.decision.engine.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="baseline/liquibase.${db.name}.create.decision.history.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.16.0-tag">
<tagDatabase tag="7.16.0"/>
</changeSet>
<changeSet author="Camunda" id="7.16-to-7.17">
<sqlFile path="upgrade/${db.name}_engine_7.16_to_7.17.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.17.0-tag">
<tagDatabase tag="7.17.0"/>
</changeSet>
<changeSet author="Camunda" id="7.17-to-7.18">
<sqlFile path="upgrade/${db.name}_engine_7.17_to_7.18.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.18.0-tag">
<tagDatabase tag="7.18.0"/>
</changeSet>
<changeSet author="Camunda" id="7.18-to-7.19">
<sqlFile path="upgrade/${db.name}_engine_7.18_to_7.19.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.19.0-tag">
<tagDatabase tag="7.19.0"/>
</changeSet>
<changeSet author="Camunda" id="7.19-to-7.20">
<sqlFile path="upgrade/${db.name}_engine_7.19_to_7.20.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.20.0-tag">
<tagDatabase tag="7.20.0"/>
</changeSet>
<changeSet author="Camunda" id="7.20-to-7.21">
<sqlFile path="upgrade/${db.name}_engine_7.20_to_7.21.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<changeSet author="Camunda" id="7.21.0-tag">
<tagDatabase tag="7.21.0"/>
</changeSet>
<changeSet author="Camunda" id="7.21-to-7.22">
<sqlFile path="upgrade/${db.name}_engine_7.21_to_7.22.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
<!-- NOTE: Changeset below is added by me. in reality this is a long list including camunda_admin and other auth groups but I cant share this -->
<changeSet id="7.22.0-test" author="Anonymous">
<insert tableName="act_ru_authorization">
<column name="id_" value="1234"/>
<column name="rev_" valueNumeric="1"/>
<column name="type_" valueNumeric="1"/>
<column name="group_id_" value="camunda_test"/>
<column name="user_id_"/>
<column name="resource_type_" valueNumeric="0"/>
<column name="resource_id_" value="*"/>
<column name="perms_" valueNumeric="2147483647"/>
<column name="removal_time_"/>
<column name="root_proc_inst_id_"/>
</insert>
</changeSet>
<changeSet author="Camunda" id="7.22.0-tag">
<tagDatabase tag="7.22.0"/>
</changeSet>
</databaseChangeLog>
Thank you for your time!
Cheers