From a8ed0de62591eef627452e1e84bf4256210e0894 Mon Sep 17 00:00:00 2001 From: pricelees Date: Thu, 2 Oct 2025 15:22:38 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Schedule=EC=9D=B4=20Hold=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EC=9D=BC=20=EB=95=8C=20=EB=A7=8C=EB=A3=8C=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=EC=97=90=20=ED=95=B4=EB=8B=B9=EB=90=98=EB=8A=94=20hol?= =?UTF-8?q?dExpiredAt=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/ScheduleEntity.kt | 2 ++ .../src/main/resources/schema/schema-h2.sql | 21 ++++++++++--------- .../main/resources/schema/schema-mysql.sql | 21 ++++++++++--------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/service/src/main/kotlin/com/sangdol/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt b/service/src/main/kotlin/com/sangdol/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt index d1379c62..bd6f2a6c 100644 --- a/service/src/main/kotlin/com/sangdol/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt +++ b/service/src/main/kotlin/com/sangdol/roomescape/schedule/infrastructure/persistence/ScheduleEntity.kt @@ -4,6 +4,7 @@ import com.sangdol.common.persistence.AuditingBaseEntity import jakarta.persistence.* import org.springframework.data.jpa.domain.support.AuditingEntityListener import java.time.LocalDate +import java.time.LocalDateTime import java.time.LocalTime @Entity @@ -19,6 +20,7 @@ class ScheduleEntity( @Enumerated(value = EnumType.STRING) var status: ScheduleStatus, + var holdExpiredAt: LocalDateTime? = null ) : AuditingBaseEntity(id) { fun modifyIfNotNull( time: LocalTime?, diff --git a/service/src/main/resources/schema/schema-h2.sql b/service/src/main/resources/schema/schema-h2.sql index 9f7b0e95..ee7218fb 100644 --- a/service/src/main/resources/schema/schema-h2.sql +++ b/service/src/main/resources/schema/schema-h2.sql @@ -114,16 +114,17 @@ create table if not exists theme ( ); create table if not exists schedule ( - id bigint primary key, - date date not null, - time time not null, - store_id bigint not null, - theme_id bigint not null, - status varchar(30) not null, - created_at timestamp not null, - created_by bigint not null, - updated_at timestamp not null, - updated_by bigint not null, + id bigint primary key, + date date not null, + time time not null, + store_id bigint not null, + theme_id bigint not null, + status varchar(30) not null, + created_at timestamp not null, + created_by bigint not null, + updated_at timestamp not null, + updated_by bigint not null, + hold_expired_at timestamp null, constraint uk_schedule__store_id_date_time_theme_id unique (store_id, date, time, theme_id), constraint fk_schedule__store_id foreign key (store_id) references store (id), diff --git a/service/src/main/resources/schema/schema-mysql.sql b/service/src/main/resources/schema/schema-mysql.sql index 56a8ee99..bc558c6d 100644 --- a/service/src/main/resources/schema/schema-mysql.sql +++ b/service/src/main/resources/schema/schema-mysql.sql @@ -114,16 +114,17 @@ create table if not exists theme ( ); create table if not exists schedule ( - id bigint primary key, - date date not null, - time time not null, - store_id bigint not null, - theme_id bigint not null, - status varchar(30) not null, - created_at datetime(6) not null, - created_by bigint not null, - updated_at datetime(6) not null, - updated_by bigint not null, + id bigint primary key, + date date not null, + time time not null, + store_id bigint not null, + theme_id bigint not null, + status varchar(30) not null, + created_at datetime(6) not null, + created_by bigint not null, + updated_at datetime(6) not null, + updated_by bigint not null, + hold_expired_at datetime(6) null, constraint uk_schedule__store_id_date_time_theme_id unique (store_id, date, time, theme_id), constraint fk_schedule__store_id foreign key (store_id) references store (id),