diff --git a/backend/src/main/java/net/pengcook/recipe/domain/RecipeStep.java b/backend/src/main/java/net/pengcook/recipe/domain/RecipeStep.java index bb72d06d..2b19b06f 100644 --- a/backend/src/main/java/net/pengcook/recipe/domain/RecipeStep.java +++ b/backend/src/main/java/net/pengcook/recipe/domain/RecipeStep.java @@ -6,6 +6,8 @@ import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import java.time.LocalTime; import lombok.AccessLevel; import lombok.AllArgsConstructor; @@ -13,9 +15,10 @@ import lombok.NoArgsConstructor; @Entity +@Getter +@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"recipe_id", "sequence"})}) @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor(access = AccessLevel.PRIVATE) -@Getter public class RecipeStep { @Id