diff --git a/backend/src/main/java/com/festago/festival/domain/Festival.java b/backend/src/main/java/com/festago/festival/domain/Festival.java index 5cc47311f..44b7bd684 100644 --- a/backend/src/main/java/com/festago/festival/domain/Festival.java +++ b/backend/src/main/java/com/festago/festival/domain/Festival.java @@ -41,6 +41,7 @@ public class Festival extends BaseTimeEntity { @Size(max = 255) private String thumbnail; + @NotNull @ManyToOne(fetch = FetchType.LAZY) private School school; diff --git a/backend/src/main/java/com/festago/ticket/domain/Ticket.java b/backend/src/main/java/com/festago/ticket/domain/Ticket.java index 1e22d76e9..b371db699 100644 --- a/backend/src/main/java/com/festago/ticket/domain/Ticket.java +++ b/backend/src/main/java/com/festago/ticket/domain/Ticket.java @@ -42,6 +42,7 @@ public class Ticket extends BaseTimeEntity { @ManyToOne(fetch = FetchType.LAZY) private Stage stage; + @NotNull private Long schoolId; @NotNull diff --git a/backend/src/main/resources/db/migration/V6__school_notnull.sql b/backend/src/main/resources/db/migration/V6__school_notnull.sql new file mode 100644 index 000000000..51735574f --- /dev/null +++ b/backend/src/main/resources/db/migration/V6__school_notnull.sql @@ -0,0 +1,5 @@ +alter table festival + modify school_id bigint not null; + +alter table ticket + modify school_id bigint not null;