In my model there is an enum field, trying to add an enum field to the database, but does not work, can you comment?
public class ChatMessage {
private MessageType messageType;
private String content;
private String sender;
public enum MessageType {
CHAT,
JOIN,
LEAVE
}
my postgre code
CREATE TYPE messageType AS ENUM ('CHAT', 'JOIN', 'LEAVE');
CREATE TABLE "chatMessage" (
id SERIAL UNIQUE PRIMARY KEY,
messageType messageType,
content VARCHAR(255) NOT NULL,
sender VARCHAR(255) NOT NULL
);
I suppose that I incorrectly declare the variable enum in postgres