Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Notification 도메인 설계 #94

Merged
merged 5 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: sql script 추가
  • Loading branch information
ddingmin committed Jun 13, 2024
commit eb10e675b4565bf65fe4d28369ae6e3af0d6b400
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import java.time.LocalDateTime
@Entity
class NotificationEntity private constructor(
@Id
@Column(name = "notification_id", columnDefinition = "CHAR(26)", nullable = false)
@Column(name = "id", columnDefinition = "CHAR(26)", nullable = false)
val id: String,

@Id
Expand All @@ -29,7 +29,7 @@ class NotificationEntity private constructor(
@Column(name = "created_at", nullable = false)
val createdAt: LocalDateTime,

@Column(name = "read_at")
@Column(name = "read_at", nullable = true)
var readAt: LocalDateTime?,
) {

Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/db/migration/V2__add_notification.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE notifications
(
id CHAR(26) NOT NULL,
member_id CHAR(26) NOT NULL,
content VARCHAR(255) NOT NULL,
type VARCHAR(255) NOT NULL,
created_at datetime NOT NULL,
read_at datetime NULL,
CONSTRAINT pk_notifications PRIMARY KEY (id)
);

ALTER TABLE notifications
ADD CONSTRAINT FK_NOTIFICATIONS_ON_MEMBER FOREIGN KEY (member_id) REFERENCES member (id);