CREATE TABLE IF NOT EXISTS booked_slot_request(
    booked_slot_request_id BIGSERIAL PRIMARY KEY,
    booked_slot_id BIGINT NOT NULL,
    request_id VARCHAR(50) NOT NULL,
    FOREIGN KEY (booked_slot_id) REFERENCES booked_slot(booked_slot_id) ON DELETE CASCADE,
    UNIQUE (booked_slot_id, request_id)
);


CREATE INDEX idx_booked_slot_request_slot_id ON booked_slot_request(booked_slot_id);
CREATE INDEX idx_booked_slot_request_request_id ON booked_slot_request(request_id);
CREATE INDEX idx_booked_slot_request_request_id_slot_id ON booked_slot_request(booked_slot_id, request_id);