I'm upgrading an application from Spring Boot 2.3.x to 3.1.0. As part of that Spring Boot upgraded Liquibase as a transitive dependency.
The issue I'm running into is that our application (along with all the changesets) has already been deployed previously into production. But after upgrading the application, while testing, I'm getting this error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Validation Failed:
6 changes have validation failures
addAfterColumn is not allowed on postgresql, file:/...
It seems to me that in the previous version of liquibase (since this changeset previously deployed to production successfully) the addAfterColumn
definition was probably just ignored where as now it's being validated and therefore failing.
I'm just curious if there is some way that I can disable the validation or configure liquibase to ignore the invalid addAfterColumn
in the changeset.
In reality, once this upgrade gets deployed to production and liquibase goes to apply the changeset, I would imagine it would just be skipped anyway since before anything (I'm assuming) liquibase would recognize that the script has already been deployed since the changeset is unmodified. But in my test environment the database is fresh so the newer version of liquibase is trying to apply the changeset. Maybe this won't be an issue once it goes out to production. But I need to be able to run this against an empty database in my local and test environments. Obviously, I can't modify the changeset since it was applied in production previously.
How can I configure either liquibase or spring boot to disable this validation or alternatively ignore this error?