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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
Navicat Premium Data Transfer
Source Server : mall_mysql
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 180.167.213.26:13306
Source Schema : mall_user
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 05/06/2019 07:58:03
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for mobile_code
-- ----------------------------
DROP TABLE IF EXISTS `mobile_code`;
CREATE TABLE `mobile_code` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`mobile` varchar(11) NOT NULL,
`code` varchar(6) NOT NULL,
`today_index` tinyint(4) NOT NULL,
`used` tinyint(4) NOT NULL,
`used_user_id` int(20) DEFAULT NULL,
`used_time` datetime DEFAULT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for oauth2_access_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth2_access_token`;
CREATE TABLE `oauth2_access_token` (
`id` varchar(32) NOT NULL,
`refresh_token` varchar(32) DEFAULT NULL,
`user_id` int(20) DEFAULT NULL,
`valid` tinyint(4) DEFAULT NULL,
`expires_time` datetime DEFAULT NULL,
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_uid` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for oauth2_refresh_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth2_refresh_token`;
CREATE TABLE `oauth2_refresh_token` (
`id` varchar(32) NOT NULL,
`user_id` int(20) DEFAULT NULL,
`valid` tinyint(4) DEFAULT NULL,
`expires_time` datetime DEFAULT NULL,
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_uid` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for user_access_log
-- ----------------------------
DROP TABLE IF EXISTS `user_access_log`;
CREATE TABLE `user_access_log` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
`user_id` int(11) NOT NULL DEFAULT '-1' COMMENT '管理员编号.',
`uri` varchar(4096) NOT NULL DEFAULT '' COMMENT '访问地址',
`query_string` varchar(4096) NOT NULL DEFAULT '' COMMENT '参数',
`method` varchar(50) NOT NULL DEFAULT '' COMMENT 'http 方法',
`user_agent` varchar(1024) NOT NULL DEFAULT '' COMMENT 'userAgent',
`ip` varchar(50) NOT NULL DEFAULT '' COMMENT 'ip',
`start_time` datetime NOT NULL COMMENT '请求时间',
`response_time` int(11) NOT NULL COMMENT '响应时长 -- 毫秒级',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10579 DEFAULT CHARSET=utf8mb4 COMMENT='admin_access_log';
-- ----------------------------
-- Table structure for user_address
-- ----------------------------
DROP TABLE IF EXISTS `user_address`;
CREATE TABLE `user_address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL COMMENT '用户编号',
`area_no` varchar(10) COLLATE utf8mb4_bin NOT NULL COMMENT '区域编号',
`name` varchar(10) COLLATE utf8mb4_bin NOT NULL COMMENT '收件人名称',
`mobile` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号',
`address` varchar(250) COLLATE utf8mb4_bin NOT NULL COMMENT '详细地址',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`has_default` int(1) NOT NULL COMMENT '是否默认',
`deleted` int(2) NOT NULL COMMENT '删除状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Table structure for user_register
-- ----------------------------
DROP TABLE IF EXISTS `user_register`;
CREATE TABLE `user_register` (
`id` int(20) NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`udpate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号',
`mobile` varchar(11) COLLATE utf8mb4_bin NOT NULL,
`nickname` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '昵称',
`avatar` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '头像',
`status` tinyint(4) DEFAULT NULL COMMENT '状态',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` bit(1) DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_uid` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
SET FOREIGN_KEY_CHECKS = 1;