为了测试目的,我尝试将H2添加到Spring application-test.yml中,我的产品Db是Oracle。我想通过液化库填充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如何调整配置以上,我花了几个小时,但不知道如何使它工作。
发布于 2019-02-14 14:04:10
增加:
jpa:
properties:
hibernate:
dialect: 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:发布于 2019-02-08 18:07:48
all_sequences是Oracle特定的DB表。您应该只迁移用户定义的表。
https://stackoverflow.com/questions/54597458
复制相似问题