-- Run this once against herp_amch database
CREATE TABLE IF NOT EXISTS `sso_tokens` (
    `id`          INT(11)      NOT NULL AUTO_INCREMENT,
    `token`       VARCHAR(64)  NOT NULL,
    `herp_userid` VARCHAR(20)  NOT NULL,
    `expires_at`  DATETIME     NOT NULL,
    `used_at`     DATETIME     DEFAULT NULL,
    `created_at`  DATETIME     NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uq_token` (`token`),
    KEY `idx_herp_userid` (`herp_userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
