Hi,
I’m using Liquibase with Spring Boot and I have a problem with a changelog parameter used in a yml file when it is running on Linux.
My property file application-dbinit.properties has several parameters defined with spring.liquibase.parameters.xy.
spring.liquibase.parameters.dbidbase = 20000
The parameter is used in many sql files and in one yml file. The file base-strasse-create-tables.yml to create a table STRASSE uses the parameter dbidbase for startWith
- createTable:
tableName: STRASSE
remarks: "Dieser Katalog enthaelt das Strassenverzeichnis der Schweiz"
columns:
- column:
name: TID
type: number(19)
autoIncrement: true
# Works on Windows, doesn't work on Linux
#startWith: ${db.id.base}
#incrementBy: ${db.id.increment}
startWith: ${dbidbase}
incrementBy: ${dbidincrement}
On Windows it works like expected, in the yaml file ${dbidbase} will be subtituted with the value 20000, but on Linux I got this error message parsing the yaml file
liquibase.exception.SetupException: Error parsing dblogs/db-init/create-tables/base-strasse-create-tables.yml
…
Caused by: java.lang.NumberFormatException: For input string: “${”
tax-sg-db | at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[na:na]
tax-sg-db | at java.base/java.lang.Integer.parseInt(Integer.java:654) ~[na:na]
tax-sg-db | at java.base/java.math.BigInteger.(BigInteger.java:538) ~[na:na]
tax-sg-db | at java.base/java.math.BigInteger.(BigInteger.java:676) ~[na:na]
tax-sg-db | at liquibase.parser.core.ParsedNode.convertObject(ParsedNode.java:257) ~[liquibase-core-4.19.0.jar!/:na]
The substitution of the parameters works in the sql files without problems on both Windows and Linux.
Another detail: on Linux it is working inside Docker.
Any suggestion what is wrong?
Regards
Sandro