我使用的是DBeaver 24.3.2、SpringBoot 3.4.1、Java 21.0.5、flyway 11.2.0。持久性库都是从spring数据继承而来的。
我最近切换到SpringBoot 3.4,在做一个示例项目时,我注意到一个非常奇怪的行为。我有以下flyway和数据源配置:
########## DATASOURCE CONFIG ##############
spring.datasource.url=jdbc:h2:file:D:/h2-dbms/rest-api/restapidb;AUTO_SERVER=TRUE;
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.h2.console.enabled=true
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
############ FLYWAY CONFIG ################
spring.flyway.user=sa
spring.flyway.password=
spring.flyway.locations=classpath:migration
我的
ddl
太简单了,甚至不值得写,在多对多关系中只有两个表。
一切正常,但如果我用DBeaver连接到我的数据库,第一次一切似乎都很正常,第二次我看到其他两个与我类似的表(区别在于前缀
HTE_
还有一列
RN_
类型整数):
正如你所看到的表格
ROLES
,
USERS
和
USERS_ROLES
是正确的,但我不知道是什么
HTE_USERS
和
HTE_ROLES
意味着。
另一件奇怪的事情是,HTE表是同一列加一列
RN_
(整数):
那是什么鬼东西??如果我使用http://localhost:8080/h2控制台上的web控制台打开数据库(始终使用文件模式,不在内存中),则不会发生任何事情。
你有什么想法吗?
注意:我显然不使用envers或其他审计框架。