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),