-
Notifications
You must be signed in to change notification settings - Fork 3
/
login_db.sql
76 lines (70 loc) · 3.01 KB
/
login_db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for user_basic_tab
-- ----------------------------
DROP TABLE IF EXISTS `user_basic_tab`;
CREATE TABLE `user_basic_tab` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(16) NOT NULL,
`user_nick` varchar(32) NOT NULL DEFAULT '',
`gender` tinyint(3) unsigned NOT NULL DEFAULT '0',
`avatar` varchar(255) NOT NULL DEFAULT '',
`signature` varchar(64) NOT NULL DEFAULT '',
`ctime` int(11) NOT NULL DEFAULT '0',
`mtime` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_uniq_name` (`user_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for user_login_tab
-- ----------------------------
DROP TABLE IF EXISTS `user_login_tab`;
CREATE TABLE `user_login_tab` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(16) NOT NULL,
`system_type` tinyint(4) unsigned NOT NULL DEFAULT '0',
`device_type` int(11) unsigned NOT NULL DEFAULT '0',
`channel_type` int(11) unsigned NOT NULL DEFAULT '0',
`device_name` varchar(16) NOT NULL DEFAULT '',
`device_id` varchar(64) NOT NULL DEFAULT '',
`ip` char(16) NOT NULL DEFAULT '',
`login_time` bigint(20) unsigned NOT NULL DEFAULT '0',
`logout_time` bigint(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_uniq_user_login` (`user_name`,`login_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for user_register_tab
-- ----------------------------
DROP TABLE IF EXISTS `user_register_tab`;
CREATE TABLE `user_register_tab` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(16) NOT NULL,
`system_type` tinyint(4) unsigned NOT NULL DEFAULT '0',
`device_type` int(11) unsigned NOT NULL DEFAULT '0',
`channel_type` int(11) unsigned NOT NULL DEFAULT '0',
`device_name` varchar(16) NOT NULL DEFAULT '',
`device_id` varchar(64) NOT NULL DEFAULT '',
`ip` char(16) NOT NULL DEFAULT '',
`ctime` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_uniq_name` (`user_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for user_secure_tab
-- ----------------------------
DROP TABLE IF EXISTS `user_secure_tab`;
CREATE TABLE `user_secure_tab` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(16) NOT NULL,
`phone_number` char(11) NOT NULL COMMENT '手机号,只考虑86的',
`passwd` char(32) NOT NULL COMMENT 'md5串,实际中用bcrypt',
`status` smallint(5) unsigned NOT NULL DEFAULT '0',
`ctime` int(11) unsigned NOT NULL DEFAULT '0',
`mtime` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_uniq_name` (`user_name`) USING BTREE,
UNIQUE KEY `idx_uniq_phone` (`phone_number`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4;
SET FOREIGN_KEY_CHECKS = 1;