liquibase + spring: relation "xxx.databasechangeloglock" does not exist when specifying liquibase-schema and default-schema

40 Views Asked by At

when not specifying these 2 properties, it works, and all tables are created in the default schema.

but when these 2 properties are specified, this error occurs:

relation "xxx.databasechangeloglock" does not exist 

how to reproduce, use this code: https://github.com/h3yzack/springboot3-liquibase-example

add

spring.liquibase.liquibase-schema: xxx
spring.liquibase.default-schema: xxx

to the properties file then rerun

1

There are 1 best solutions below

0
Lautert On

I had to do some updates to the pom.xml and it worked. Basically upgraded to java version 21 + springboot 3.2.3:

diff --git a/pom.xml b/pom.xml index b749187..a0f1ca7 100644
--- a/pom.xml
+++ b/pom.xml @@ -5,7 +5,7 @@   <parent>        <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-parent</artifactId>
-       <version>3.0.3</version>
+       <version>3.2.3</version>        <relativePath/>         <!-- lookup parent from repository -->      </parent> @@ -17,8 +17,8 @@     <description>Example project for Spring Boot with liquibase</description>
    <properties>
-       <java.version>19</java.version>
-       <spring-boot.ver>3.0.2</spring-boot.ver>
+       <java.version>21</java.version>
+       <spring-boot.ver>3.2.3</spring-boot.ver>        <liquibase-maven-plugin.version>4.19.0</liquibase-maven-plugin.version>         <liquibase-hibernate.version>4.19.0</liquibase-hibernate.version>   </properties>

After starting a postgresql docker instance it ran fine:

[INFO] Differences written to Change Log File, src/main/resources/db/changelog/migration/_1.0_migrate.sql
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS