spring-modulith
spring-modulith copied to clipboard
JPA-based event publications created by JPA provider using wrong column definition in PostgreSQL
trafficstars
Hey @odrotbohm, I found a strange aberration. I created a simple application with JPA + PostgreSQL, I let JPA create the schema (I know, I know you recommend creating it yourself). However, documentation says that the columns should be TEXT, but when JPA initializes the default schema, it defines a varchar(255), which is quite small for serialized_event.
Definition from documentation:
CREATE TABLE IF NOT EXISTS event_publication
(
id UUID NOT NULL,
listener_id TEXT NOT NULL,
event_type TEXT NOT NULL,
serialized_event TEXT NOT NULL,
publication_date TIMESTAMP WITH TIME ZONE NOT NULL,
completion_date TIMESTAMP WITH TIME ZONE,
PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS event_publication_serialized_event_hash_idx ON event_publication USING hash(serialized_event);
CREATE INDEX IF NOT EXISTS event_publication_by_completion_date_idx ON event_publication (completion_date);
Is the documentation outdated, or is something wrong with the spring-modulith-starter-jpa package ?