-- Screen share sessions: short codes for viewers to join a share. Used by validate_screen_share_code.php and register_screen_share.php.
CREATE TABLE IF NOT EXISTS screen_share_sessions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(16) NOT NULL,
    device_id VARCHAR(255) DEFAULT NULL,
    created_at DATETIME NOT NULL,
    expires_at DATETIME NOT NULL,
    UNIQUE KEY uk_code (code),
    KEY idx_expires (expires_at)
);

CREATE TABLE IF NOT EXISTS ftt_screen_share_sessions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(16) NOT NULL,
    device_id VARCHAR(255) DEFAULT NULL,
    created_at DATETIME NOT NULL,
    expires_at DATETIME NOT NULL,
    UNIQUE KEY uk_code (code),
    KEY idx_expires (expires_at)
);
