gpt4 book ai didi

java - H2 - Oracle - liquibase - org.h2.jdbc.JdbcSQLException : Table "all_sequences" not found;

转载 作者:行者123 更新时间:2023-12-01 14:14:20 26 4
gpt4 key购买 nike

我尝试将 H2 用于测试目的添加到 Spring Boot application-test.yml ,我的生产数据库是Oracle。我想通过 liquibase 填充 H2 模式,但收到以下错误:

Caused by: org.h2.jdbc.JdbcSQLException: Table "all_sequences" not found; SQL statement:



我的配置如下:
spring:
profiles:
active: test
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=Oracle
username: sa
password:
platform: h2
driver-class-name: org.h2.Driver

jpa:
hibernate:
ddl-auto: none
generate-ddl: true

h2:
console:
enabled: true
path: /console

liquibase:
url: ${spring.datasource.url}
enabled: true
user: sa
password:
change-log: classpath:liquibase/test-master.xml
drop-first: true

如何调整上面的配置,我花了几个小时,但不知道如何使它工作。

最佳答案

添加:

jpa:
properties:
hibernate:
org.hibernate.dialect.H2Dialect

解决了问题。

完整配置:
spring:
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=Oracle
username: sa
password:
platform: h2
driver-class-name: org.h2.Driver
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: none
generate-ddl: true

liquibase:
url: ${spring.datasource.url}
contexts: test
change-log: classpath:liquibase/test-master.xml
user: sa
password:

关于java - H2 - Oracle - liquibase - org.h2.jdbc.JdbcSQLException : Table "all_sequences" not found;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54597458/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com