Skip to content

Commit

Permalink
feat: 유니크 제약 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
peeerr committed Nov 14, 2024
1 parent d52c56c commit 731a17e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/potatocake/everymoment/entity/Like.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Table(name = "likes")
@Table(
name = "likes",
uniqueConstraints = {
@UniqueConstraint(columnNames = {"member_id", "diary_id"})
}
)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
Expand Down

0 comments on commit 731a17e

Please sign in to comment.