我使用 Spring Boot 2.6.8 和 Liquibase,效果很好。在生产环境中运行时,它与 MySQL 数据库一起使用。对于集成测试,我们针对内存数据库中的 H2 运行它。
自从升级到 SB 2.7.0(将 H2 v1.4.200 切换到 v2.1.212)后,Liquibase 就会失败,H2 会出现在内存数据库中。
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.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set changelog/0.3.0/tables/file_type.xml::1437572803912-1::bobd (generated):
Reason: liquibase.exception.DatabaseException: Syntax error in SQL statement "CREATE TABLE PUBLIC.FILE_TYPE (ID INT[*](10) GENERATED BY DEFAULT AS IDENTITY NOT NULL, NAME VARCHAR(45) NOT …Run Code Online (Sandbox Code Playgroud)