Skip to content

Commit

Permalink
refactor : Comment와 Emoji에 Goal Delete Casacade 속성 추가 (#246) (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-ho authored Apr 7, 2024
1 parent c4dba1a commit 78b7956
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import org.hibernate.annotations.Nationalized
import org.hibernate.annotations.OnDelete
import org.hibernate.annotations.OnDeleteAction

@Entity
@Table(name = "COMMENTS")
class Comment(
@ManyToOne
@JoinColumn(name = "goal_id")
@OnDelete(action = OnDeleteAction.CASCADE)
val goal: Goal,

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import jakarta.persistence.UniqueConstraint
import org.hibernate.annotations.OnDelete
import org.hibernate.annotations.OnDeleteAction

@Entity
@Table(
Expand All @@ -22,6 +24,7 @@ import jakarta.persistence.UniqueConstraint
class ReactedEmoji(
@ManyToOne
@JoinColumn(name = "goal_id")
@OnDelete(action = OnDeleteAction.CASCADE)
val goal: Goal,

@ManyToOne
Expand Down

0 comments on commit 78b7956

Please sign in to comment.