-- Score bands and the action taken for each classification. One row per band.
-- A session scoring >= human.min_score is Human; else >= suspicious.min_score
-- is Suspicious; otherwise Bot.
CREATE TABLE IF NOT EXISTS `thresholds` (
    `id`         BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    `band`       ENUM('human','suspicious','bot') NOT NULL,
    `min_score`  TINYINT UNSIGNED NOT NULL DEFAULT 0,
    `action`     VARCHAR(30)     NOT NULL DEFAULT 'block',  -- redirect_primary/redirect_alternate/block/allow
    `updated_at` DATETIME        NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uq_thr_band` (`band`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
