-- Tabela de proteção contra força bruta
CREATE TABLE IF NOT EXISTS brute_force_attempts (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    ip_address VARCHAR(45) NOT NULL,
    type VARCHAR(50) NOT NULL DEFAULT 'login',
    identifier VARCHAR(255) NULL COMMENT 'Email ou outro identificador',
    attempted_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_ip_type (ip_address, type),
    INDEX idx_attempted_at (attempted_at),
    INDEX idx_ip_attempted (ip_address, attempted_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Registro de tentativas de força bruta';

