You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Liquibase to update my database from two sides:
Via the Liquibase Maven plugin
Via Spring with SpringLiquibase that updates the database upon application startup
Running vacuum from the db-changelog-master.xml like the following code snippet works for now. (By setting validCheckSum to ANY. But without it database updates only succeed when run from one of the two sides described above. F.i. when it has run via SpringLiquibase, and is run again via SpringLiquibase, all is fine. Checksum is ok. But when I then update the database via Maven a checksum error occurs. The checksum is different when run from Maven then when run from SpringLiquibase.
Maybe it has something do with logicalFilePath. Without it, it seems to run ok, but then I run into other issues with Spring filename path using classpath:... etc..
Using: Java 7, Postgresql 9.4 with postgis, Spring 4.1.6, Liquibase 3.3.3, Liquibase-spacial 1.2.1, liquibase-postgresql 3.0
Note: Same checksum error occurs when using another extension, liquibase-spatial. With this extension specifically on the creation of a spatial index. See lonnyj/liquibase-spatial#7
File db-changelog-master.xml:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLogxmlns="http://www.liquibase.org/xml/ns/dbchangelog"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"logicalFilePath="db-changelog-master.xml">
<includefile="db-changelog-initial-schema-1.0.xml"relativeToChangelogFile="true"/>
<includefile="db-changelog-sprint-x.xml"relativeToChangelogFile="true"/>
<includefile="db-changelog-spacial-example.xml"relativeToChangelogFile="true"/>
<changeSetid="maintenance: vacuum postgres"author="bvlangen"runInTransaction="false"runAlways="true">
<!-- Checksum differs when run from Maven or Spring, therefore set to valid ANY -->
<validCheckSum>ANY</validCheckSum>
<comment>Vacuum the PostgreSQL database</comment>
<ext:vacuum/>
</changeSet>
</databaseChangeLog>
<changeSetid="Create spatial index"author="bvlangen">
<!-- Checksum differs when run from Maven or Spring, therefore set to valid ANY and added precondition -->
<validCheckSum>ANY</validCheckSum>
<preConditions>
<not>
<spatial:spatialIndexExiststableName="EXAMPLE"columnNames="GEOM" />
</not>
</preConditions>
<comment>Create spatial index</comment>
<spatial:createSpatialIndextableName="EXAMPLE"indexName="EXAMPLE_GEOM_IDX"geometryType="Point"srid="4326">
<columnname="GEOM" />
</spatial:createSpatialIndex>
</changeSet>
I'm using Liquibase to update my database from two sides:
Running vacuum from the db-changelog-master.xml like the following code snippet works for now. (By setting validCheckSum to ANY. But without it database updates only succeed when run from one of the two sides described above. F.i. when it has run via SpringLiquibase, and is run again via SpringLiquibase, all is fine. Checksum is ok. But when I then update the database via Maven a checksum error occurs. The checksum is different when run from Maven then when run from SpringLiquibase.
Maybe it has something do with logicalFilePath. Without it, it seems to run ok, but then I run into other issues with Spring filename path using classpath:... etc..
Using: Java 7, Postgresql 9.4 with postgis, Spring 4.1.6, Liquibase 3.3.3, Liquibase-spacial 1.2.1, liquibase-postgresql 3.0
Note: Same checksum error occurs when using another extension, liquibase-spatial. With this extension specifically on the creation of a spatial index. See lonnyj/liquibase-spatial#7
File db-changelog-master.xml:
Spring config:
Snippet db-changelog-spacial-example.xml:
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: