diff --git a/backend/src/main/java/com/example/todoapp/model/Stocks.java b/backend/src/main/java/com/example/todoapp/model/Stocks.java index 921313f..d297ab9 100644 --- a/backend/src/main/java/com/example/todoapp/model/Stocks.java +++ b/backend/src/main/java/com/example/todoapp/model/Stocks.java @@ -62,7 +62,7 @@ public class Stocks { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn( name = "user_id", - referencedColumnName = "user_id", + referencedColumnName = "id", nullable = false ) private User user_id; @@ -94,7 +94,7 @@ public class Stocks { /** * 賞味期限 */ - @Column(nullable = false) + @Column(nullable = true) private LocalDate exp_date; } \ No newline at end of file diff --git a/backend/src/main/java/com/example/todoapp/model/ToBuys.java b/backend/src/main/java/com/example/todoapp/model/ToBuys.java index ddddfe0..441e821 100644 --- a/backend/src/main/java/com/example/todoapp/model/ToBuys.java +++ b/backend/src/main/java/com/example/todoapp/model/ToBuys.java @@ -58,7 +58,7 @@ public class ToBuys { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn( name = "user_id", - referencedColumnName = "user_id", + referencedColumnName = "id", nullable = false ) private User user_id; @@ -73,9 +73,8 @@ public class ToBuys { /** * 購入するお店 */ - @NotBlank @Column(nullable = true) - private String store; + private String shop; }