From 3748df9351fee1c668e8160bedbcc995d531ced3 Mon Sep 17 00:00:00 2001 From: pricelees Date: Fri, 3 Oct 2025 16:22:12 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20mysql=20=EC=8A=A4=ED=82=A4=EB=A7=88?= =?UTF-8?q?=20=ED=8C=8C=EC=9D=BC=EC=97=90=20=EC=9D=B8=EB=8D=B1=EC=8A=A4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/src/main/resources/schema/schema-mysql.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service/src/main/resources/schema/schema-mysql.sql b/service/src/main/resources/schema/schema-mysql.sql index bc558c6d..c3a4ab47 100644 --- a/service/src/main/resources/schema/schema-mysql.sql +++ b/service/src/main/resources/schema/schema-mysql.sql @@ -128,7 +128,9 @@ create table if not exists schedule ( 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), - constraint fk_schedule__theme_id foreign key (theme_id) references theme (id) + constraint fk_schedule__theme_id foreign key (theme_id) references theme (id), + index idx_schedule__status_hold_expired_at (status, hold_expired_at, id), + index idx_schedule__status_date_theme_id_id (status, date, theme_id, id) ); create table if not exists reservation ( @@ -146,7 +148,9 @@ create table if not exists reservation ( updated_by bigint not null, constraint fk_reservation__user_id foreign key (user_id) references users (id), - constraint fk_reservation__schedule_id foreign key (schedule_id) references schedule (id) + constraint fk_reservation__schedule_id foreign key (schedule_id) references schedule (id), + index idx_reservation__schedule_id_status (schedule_id, status), + index idx_reservation__status_schedule_id_created_at (status, schedule_id, created_at) ); create table if not exists canceled_reservation (