From 7cfc7a4d9f687d9ebd1ef88d7d076c2ebb8a54fe Mon Sep 17 00:00:00 2001 From: pricelees Date: Thu, 18 Sep 2025 15:30:09 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20schedule=20=EC=8A=A4=ED=82=A4?= =?UTF-8?q?=EB=A7=88=EC=9D=98=20=EA=B8=B0=EC=A1=B4=20unique=20=EC=A0=9C?= =?UTF-8?q?=EC=95=BD=EC=A1=B0=EA=B1=B4=EC=97=90=20storeId=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/infrastructure/persistence/ScheduleEntity.kt | 2 +- src/main/resources/schema/schema-h2.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt b/src/main/kotlin/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt index 6762d310..a8023d00 100644 --- a/src/main/kotlin/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt +++ b/src/main/kotlin/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt @@ -13,7 +13,7 @@ import java.time.LocalTime @Entity @EntityListeners(AuditingEntityListener::class) -@Table(name = "schedule", uniqueConstraints = [UniqueConstraint(columnNames = ["date", "time", "theme_id"])]) +@Table(name = "schedule", uniqueConstraints = [UniqueConstraint(columnNames = ["storeId", "date", "time", "theme_id"])]) class ScheduleEntity( id: Long, diff --git a/src/main/resources/schema/schema-h2.sql b/src/main/resources/schema/schema-h2.sql index 81ee9a9c..e462b8b4 100644 --- a/src/main/resources/schema/schema-h2.sql +++ b/src/main/resources/schema/schema-h2.sql @@ -125,7 +125,7 @@ create table if not exists schedule ( updated_at timestamp not null, updated_by bigint not null, - constraint uk_schedule__date_time_theme_id unique (date, time, theme_id), + constraint uk_schedule__store_id_date_time_theme_id unique (store_id, date, time, theme_id), constraint fk_schedule__theme_id foreign key (theme_id) references theme (id) );