CREATE TABLE IF NOT EXISTS launcher_logs (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    event_type VARCHAR(80) NOT NULL,
    severity VARCHAR(30) NOT NULL,
    message TEXT NULL,
    user_name VARCHAR(120) NULL,
    machine_name VARCHAR(120) NULL,
    client_ip VARCHAR(45) NULL,
    launcher_version VARCHAR(40) NULL,
    server_domain VARCHAR(120) NULL,
    server_port INT NULL,
    detected_reason VARCHAR(80) NULL,
    detected_value VARCHAR(255) NULL,
    detected_process VARCHAR(160) NULL,
    detected_process_id INT NULL,
    detected_window_title VARCHAR(255) NULL,
    detected_exe_hash VARCHAR(80) NULL,
    raw_json JSON NULL,
    PRIMARY KEY (id),
    KEY idx_created_at (created_at),
    KEY idx_event_type (event_type),
    KEY idx_client_ip (client_ip),
    KEY idx_detected_process (detected_process)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
