Liquibase Checksum Error

I am using Liquibase (3.5.1) in a Springboot application. I am using SQL change log files. Adding a new set of changes ultimately showed a checksum error for the previous set of changes.

Initial Change File -

 --liquibase formatted sql --changeset tanmoy:1 create table serviceInstances ( serviceId varchar(60), orgId varchar(60), spaceId varchar(60), primary key (serviceId,orgId) ); 

When adding a new set of changes like this -

 --changeset tanmoy:2 create table serviceBindings ( bindingId varchar(30) primary key, serviceId varchar(30), appId varchar(30), timeStamp BIGINT ); 

the migration failed with these error logs -

 Caused by: liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum classpath:/db/changelog/db.changelog-master.sql::1::tanmoy was: 7:d15516f48de6531d1727cca8c56ec95a but is now: 7:3c7718f34f78701e0d2cadbf8278c1fa at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:266) ~[liquibase-core-3.5.1.jar:na] at liquibase.Liquibase.update(Liquibase.java:210) ~[liquibase-core-3.5.1.jar:na] at liquibase.Liquibase.update(Liquibase.java:192) ~[liquibase-core-3.5.1.jar:na] at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:434) ~[liquibase-core-3.5.1.jar:na] at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:391) ~[liquibase-core-3.5.1.jar:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] ... 16 common frames omitted 

I do not understand why the checksum of the previous shift is changed and not verified. Is it because I added a new change file to the change log file? If this is how I can add a new set of changes?

+7
source share
1 answer

At the process level, the entire process runs incrementally . For example, when we create a table and want to make changes to the table, we give you a new incremental number. Using this number, we determine the changes that we make to the one we create. As if you are adding something new to your question. Therefore, you need to increase the id in your liquibase.xml file. If you have made changes to your current schedule, do it as follows.

 <changeSet id="73" author="fcelik"> <comment>This change adds to customer_order table.</comment> <addColumn tableName="customer_order"> <column name="owner_id" type="BIGINT"> <constraints nullable="false"/> </column> </addColumn> </changeSet> 

Your file should have unrivaled value for your liquabase.xml . What you want to do between them (usually an incremental path is tracked) to create a file. For example, I added a new column to the customer_order table. Note that <addColumn> when using the tag.

0
source

All Articles