Skip to content

Commit

Permalink
#271: make message id optional
Browse files Browse the repository at this point in the history
  • Loading branch information
gessnerfl committed Oct 13, 2023
1 parent 431b74f commit a17db4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/de/gessnerfl/fakesmtp/model/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class Email {
@Basic(optional = false)
private String rawData;

@Column(name = "message_id", nullable = false)
@Basic(optional = false)
@Column(name = "message_id", nullable = true)
@Basic(optional = true)
private String messageId;

@OneToMany(mappedBy = "email", cascade = CascadeType.ALL, orphanRemoval = true)
Expand Down Expand Up @@ -148,8 +148,8 @@ public List<InlineImage> getInlineImages() {
return inlineImages;
}

public String getMessageId() {
return messageId;
public Optional<String> getMessageId() {
return Optional.ofNullable(messageId);
}

public void setMessageId(String messageId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE email (
subject CLOB NOT NULL,
received_on TIMESTAMP NOT NULL,
raw_data CLOB NOT NULL,
message_id VARCHAR(255) NOT NULL,
message_id VARCHAR(255),
PRIMARY KEY (id)
);

Expand Down

0 comments on commit a17db4e

Please sign in to comment.