CREATE TABLE IF NOT EXISTS rate_limits (
    action_key VARCHAR(128) PRIMARY KEY,
    attempts INT UNSIGNED NOT NULL DEFAULT 1,
    window_start DATETIME NOT NULL,
    INDEX idx_window (window_start)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
