ALTER TABLE events
    ADD COLUMN audience_mode ENUM('all','restricted') NOT NULL DEFAULT 'all' AFTER public_registration_enabled;

CREATE TABLE event_allowed_participant_types (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    event_id BIGINT UNSIGNED NOT NULL,
    participant_type_id BIGINT UNSIGNED NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY uq_event_allowed_participant_types (event_id, participant_type_id),
    CONSTRAINT fk_eapt_event FOREIGN KEY (event_id) REFERENCES events(id) ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_eapt_participant_type FOREIGN KEY (participant_type_id) REFERENCES maintenance_items(id) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB;
