我正在迁移到 SpringBoot 3.0.1 并将“hibernate-envers”版本更新为“6.1.6.Final”。我的数据库是 PostgreSQL 13.6。Hibernate 配置为创建数据库模式:
spring.jpa.hibernate.ddl-auto:create
启动应用程序后,我收到以下错误:
pim 2022-12-27 12:00:13,715 WARN C#c7b942ec-33b4-4749-b113-22cbb2946a8d [http-nio-9637-exec-1] SqlExceptionHelper/133 - SQL Error: 0, SQLState: 42P01
pim 2022-12-27 12:00:13,715 ERROR C#c7b942ec-33b4-4749-b113-22cbb2946a8d [http-nio-9637-exec-1] SqlExceptionHelper/138 - ERROR: relation "revinfo_seq" does not exist
Position: 16
Run Code Online (Sandbox Code Playgroud)
revinfo 表如下所示:
create table revinfo
(
revision bigint not null
primary key,
client_id varchar(255),
correlation_id varchar(255),
origin varchar(255),
request_id varchar(255),
revision_timestamp bigint not null,
timestamp_utc timestamp with time zone,
user_name varchar(255)
);
Run Code Online (Sandbox Code Playgroud)
序列“revinfo_seq”不存在,但在带有 envers 的旧数据库结构中
5.6.8.Final
Run Code Online (Sandbox Code Playgroud)
而 SpringBoot 2.6.6 它也不存在,没有任何问题。我缺少什么?
我尝试切换参数
org.hibernate.envers.use_revision_entity_with_native_id …Run Code Online (Sandbox Code Playgroud)