refactor: mysql 스키마 파일에 인덱스 추가

This commit is contained in:
이상진 2025-10-03 16:22:12 +09:00
parent a50cbbe43e
commit 3748df9351

View File

@ -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 (