CREATE TABLE `login_attempt` (
    `id`           BIGINT UNSIGNED       NOT NULL AUTO_INCREMENT,
    `key_type`     ENUM('ip','email')    NOT NULL,
    `key_value`    VARCHAR(255)          NOT NULL,
    `attempted_at` DATETIME              NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    KEY `idx_key_time` (`key_type`, `key_value`, `attempted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
