-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuto_Users
More file actions
23 lines (22 loc) · 1.39 KB
/
Auto_Users
File metadata and controls
23 lines (22 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- autotest.Auto_Users definition
CREATE TABLE `Auto_Users` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户唯一标识',
`username` varchar(100) NOT NULL UNIQUE COMMENT '用户名',
`email` varchar(255) DEFAULT NULL UNIQUE COMMENT '邮箱地址',
`password_hash` varchar(255) NOT NULL COMMENT '密码哈希值',
`display_name` varchar(100) DEFAULT NULL COMMENT '显示名称',
`status` enum('active','inactive','locked') DEFAULT 'active' COMMENT '用户状态',
`role` varchar(50) DEFAULT 'user' COMMENT '用户角色',
`avatar` varchar(255) DEFAULT NULL COMMENT '头像URL',
`login_attempts` int(11) DEFAULT 0 COMMENT '登录失败次数',
`locked_until` datetime DEFAULT NULL COMMENT '账号锁定截止时间',
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
`reset_token` varchar(255) DEFAULT NULL COMMENT '密码重置令牌',
`reset_token_expires` datetime DEFAULT NULL COMMENT '密码重置令牌过期时间',
`remember_token` varchar(255) DEFAULT NULL COMMENT '记住登录令牌',
`created_at` datetime DEFAULT current_timestamp() COMMENT '创建时间',
`updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_username` (`username`),
UNIQUE KEY `uniq_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表';