Files
superlink/sql/migration_v1.0.51.sql
T

20 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ============================================================
-- v1.0.51 批次1「架构筑基」迁移
-- 1) 登录限流表(security.php 的 checkLoginThrottle/recordLoginAttempt 依赖)
-- 2) 清理 v1.0.48 遗留的 preliminary_data 冗余备份表
-- ============================================================
CREATE TABLE IF NOT EXISTS `system_login_attempts` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '登录账号',
`ip` VARCHAR(45) NOT NULL DEFAULT '' COMMENT '客户端IP(IPv6最多45字符)',
`success` TINYINT NOT NULL DEFAULT 0 COMMENT '1=成功 0=失败',
`attempt_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_ip_user_time` (`ip`, `username`, `attempt_time`),
KEY `idx_attempt_time` (`attempt_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='登录尝试记录(限流/防爆破)';
-- 清理 v1.0.48 遗留冗余备份表(架构评审 REV-ARCH-1)
DROP TABLE IF EXISTS `preliminary_data_bak_20260810b`;