Hi,
as mentioned here and here I try to use logicalFilePath for path independend changeset checksums on loading data from CSV files. I put it on both, <databaseChangeLog> and <changeSet> elements. Additionally, I set relativeToChangelogFile=false and use the recommended classpath style file reference (file="liquibase/roles.csv") due to the files are within the classpath.
But unfortunately, it doesn't work. The checksums are different for starting the integration on command line and as part of the Spring Boot application startup. Here the results from the command line:
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for inputStream as 9ca12c1c8a646e2aa3c9de7db6871e9e
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for role:7:9ca12c1c8a646e2aa3c9de7db6871e9e as 0af5068f2af10c618ed34b5b9f66daf1
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for 7:0af5068f2af10c618ed34b5b9f66daf1: as be657117b215fb13dfbe9077acc0efd9
And here the results from the Spring Boot startup:
10:43:12.889 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Opening file:/Users/Dominik/Documents/quarton/qPRO5/backend/target/classes/liquibase/roles.csv as liquibase/roles.csv
10:43:12.890 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for inputStream as 51984d97436e4dc00c9ff4a727d6e08e
10:43:12.891 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for role:7:51984d97436e4dc00c9ff4a727d6e08e as 188bda59133861f4a3ec193a83c51b03
10:43:12.891 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for 7:188bda59133861f4a3ec193a83c51b03: as 358fce93e634f2c95acb48e2cf604713
10:43:13.170 [] WARN otationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
liquibase/changelogs::loadDefaultRoles::dominik was: 7:be657117b215fb13dfbe9077acc0efd9 but is now: 7:358fce93e634f2c95acb48e2cf604713
Here the relevant part of the changelog.xml
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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.5.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd" logicalFilePath="liquibase/changelogs" context="default">
<changeSet id="loadDefaultRoles" author="dominik" logicalFilePath="liquibase/changelogs">
<loadData tableName="role" file="liquibase/roles.csv" separator="," relativeToChangelogFile="false">
<column name="id" type="numeric" />
<column name="name" type="string" />
</loadData>
</changeSet>
What should I do in order to start 'liquibase update' from the command line and afterwards also the checksum check during the Spring Boot startup doesn't fail ?
Kind regards
Dominik
as mentioned here and here I try to use logicalFilePath for path independend changeset checksums on loading data from CSV files. I put it on both, <databaseChangeLog> and <changeSet> elements. Additionally, I set relativeToChangelogFile=false and use the recommended classpath style file reference (file="liquibase/roles.csv") due to the files are within the classpath.
But unfortunately, it doesn't work. The checksums are different for starting the integration on command line and as part of the Spring Boot application startup. Here the results from the command line:
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for inputStream as 9ca12c1c8a646e2aa3c9de7db6871e9e
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for role:7:9ca12c1c8a646e2aa3c9de7db6871e9e as 0af5068f2af10c618ed34b5b9f66daf1
DEBUG 01.02.17 09:01: liquibase: liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for 7:0af5068f2af10c618ed34b5b9f66daf1: as be657117b215fb13dfbe9077acc0efd9
And here the results from the Spring Boot startup:
10:43:12.889 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Opening file:/Users/Dominik/Documents/quarton/qPRO5/backend/target/classes/liquibase/roles.csv as liquibase/roles.csv
10:43:12.890 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for inputStream as 51984d97436e4dc00c9ff4a727d6e08e
10:43:12.891 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for role:7:51984d97436e4dc00c9ff4a727d6e08e as 188bda59133861f4a3ec193a83c51b03
10:43:12.891 [] DEBUG liquibase - liquibase/changelogs: liquibase/changelogs::loadDefaultRoles::dominik: Computed checksum for 7:188bda59133861f4a3ec193a83c51b03: as 358fce93e634f2c95acb48e2cf604713
10:43:13.170 [] WARN otationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
liquibase/changelogs::loadDefaultRoles::dominik was: 7:be657117b215fb13dfbe9077acc0efd9 but is now: 7:358fce93e634f2c95acb48e2cf604713
Here the relevant part of the changelog.xml
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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.5.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd" logicalFilePath="liquibase/changelogs" context="default">
<changeSet id="loadDefaultRoles" author="dominik" logicalFilePath="liquibase/changelogs">
<loadData tableName="role" file="liquibase/roles.csv" separator="," relativeToChangelogFile="false">
<column name="id" type="numeric" />
<column name="name" type="string" />
</loadData>
</changeSet>
What should I do in order to start 'liquibase update' from the command line and afterwards also the checksum check during the Spring Boot startup doesn't fail ?
Kind regards
Dominik