spring-projects / spring-projects/spring-modulith
JPA-based event publications created by JPA provider using wrong column definition in PostgreSQL
Open
@odrotbohm is already working on this.
Since Feb 23, 2025.
in: event publication registry
meta: waiting for feedback
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
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 ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.