Property substituting format

I’m currently updating liquibase from 3.10.3 to 4.18.0. I got problems with custom change set where our code also does property substituting.

Substituting Properties in Changelogs | Liquibase Docs

In that page it says:

Note: If you do not want to replace an otherwise matching ${property-name} expression, add : to the beginning of the expression. An expression of ${: property-name} will always be converted to ${property-name} regardless of whether property-name is defined.

One side note: It says that add “:” but example contains space. Maybe this is documentation issue.

But should this work? I tried “${: property-name}” and “${:property-name}”. With and without space. But those are not changed to expected “${property-name}” value.

Here is an example of one change set and what liquibase writes into log (find&replace was used to hide private information):

<changeSet author="nn" id="u/AAU" runOnChange="true">
  <customChange class="e.a.d.i.SC">
     <param name="updateFileName" value="u/AAU.sql"/>
     <param name="parameters" value="$${:language.${:country}};${:aa.p}"/>
  </customChange>
</changeSet>

[8:11:28|FINE]: Computed checksum for customChange:[
class=“e.a.d.i.SC”
param={
parameters=“$${:language.${:country}};${:aa.p}”,
updateFileName=“u/AAU.sql”
}

1 Like

Same here. Have you solved this?

Seems at 4.23.0 still have same issue

According to the source code:
/org/liquibase/liquibase-core/4.23.0/liquibase-core-4.23.0-sources.jar!/liquibase/changelog/ExpressionExpander.java:49


There still have to set --support-property-escaping=true

I resolved it. you can reference the below step.

Hello. Could you please help me solve a similar problem? I work with Spring-Boot 3.1.5. and Liquibase 4.19.0. I have SQL migration but ${:} doesn’t work.

--liquibase formatted sql
--changeset test:001
--support-property-escaping=true

CREATE TABLE test
(
    id BIGSERIAL PRIMARY KEY,
    name       VARCHAR(50) NOT NULL,
    createdOn  TIMESTAMP          NOT NULL DEFAULT CURRENT_TIMESTAMP,
    modifiedOn TIMESTAMP          NOT NULL DEFAULT CURRENT_TIMESTAMP
);

INSERT INTO test (name) VALUES ('${:username}');