CREATE TABLE IF NOT EXISTS satellite_mode_booked_slot (
    id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    mode_id BIGINT NOT NULL REFERENCES satellite_modes(id) ON DELETE CASCADE,
    booked_slot_id BIGINT NOT NULL,
    CONSTRAINT uq_satellite_mode_booked_slot_mode_booked_slot UNIQUE(mode_id, booked_slot_id)
);

CREATE INDEX IF NOT EXISTS idx_satellite_mode_booked_slot_mode_id
    ON satellite_mode_booked_slot(mode_id);

CREATE INDEX IF NOT EXISTS idx_satellite_mode_booked_slot_booked_slot_id
    ON satellite_mode_booked_slot(booked_slot_id);
