Skip to content

Commit

Permalink
♻️ refactor(notification): make NotificationAction nullable false
Browse files Browse the repository at this point in the history
  • Loading branch information
siyeonSon committed Apr 6, 2024
1 parent 77c0f23 commit b053cef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class AllPushRequestDto {
@NotNull
private String content;

@NotNull
private String path;

@NotNull
private String pid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ public class PushRequestDto {
@NotNull
private String content;

@NotNull
private NotificationType notificationType;

@NotNull
private String path;

@NotNull
private String pid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ CREATE TABLE IF NOT EXISTS users_device (

CREATE TABLE IF NOT EXISTS notification_action (
notification_action_id BIGINT NOT NULL AUTO_INCREMENT,
path VARCHAR(255),
pid VARCHAR(255),
path VARCHAR(255) NOT NULL,
pid VARCHAR(255) NOT NULL,
PRIMARY KEY(notification_action_id)
);

Expand All @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS notification (
notification_type VARCHAR(255) NOT NULL,
is_viewed BIT NOT NULL,
user_device_id BIGINT NOT NULL,
notification_action_id BIGINT NULL,
notification_action_id BIGINT NOT NULL,
created_at DATETIME(6) NOT NULL,
modified_at DATETIME(6) NOT NULL,
PRIMARY KEY(notification_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Notification extends BaseTimeEntity {
private UserDevice userDevice;

@OneToOne(fetch = LAZY, cascade = ALL)
@JoinColumn(name = "notification_action_id")
@JoinColumn(name = "notification_action_id", nullable = false)
private NotificationAction notificationAction;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public class NotificationAction {
@Column(name = "notification_action_id")
private Long id;

@Column(nullable = false)
private String path;

@Column(nullable = false)
private String pid;

@Builder
Expand Down

0 comments on commit b053cef

Please sign in to comment.