feat: 完善用户治理与登录白名单
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS im_user_ip_whitelists (
|
||||
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||
user_id BIGINT NOT NULL,
|
||||
ip_cidr VARCHAR(64) NOT NULL COMMENT 'IPv4, IPv6 or CIDR',
|
||||
status TINYINT NOT NULL DEFAULT 1 COMMENT '1 enabled, 2 disabled',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
created_by BIGINT NOT NULL DEFAULT 0,
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
updated_by BIGINT NOT NULL DEFAULT 0,
|
||||
deleted_at DATETIME(3) DEFAULT NULL,
|
||||
deleted_by BIGINT DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_im_user_ip_whitelist (user_id, ip_cidr),
|
||||
KEY idx_im_user_ip_whitelist_user (user_id, status),
|
||||
KEY idx_im_user_ip_whitelist_deleted (deleted_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Per-user login IP whitelist';
|
||||
Reference in New Issue
Block a user