![](/img/trans.png)
[英]org.h2.jdbc.JdbcSQLException: Table “ALL_SEQUENCES” not found
[英]H2 - Oracle - liquibase - org.h2.jdbc.JdbcSQLException: Table "all_sequences" not found;
我嘗試將 H2 用於測試目的添加到 Spring Boot application-test.yml
,我的生產數據庫是 Oracle。 我想通過 liquibase 填充 H2 模式,但收到以下錯誤:
引起:org.h2.jdbc.JdbcSQLException:找不到表“all_sequences”; SQL語句:
我的配置如下:
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:
all_sequences是 Oracle 特定的數據庫表。 您應該只遷移用戶定義的表。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.