数据库设计 - 3.1.x
数据库建表语句仅供参考,一般不需要手动执行建表语句,蓝眼云盘在安装引导程序中会自动建表。
CREATE TABLE `tank31_bridge` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`share_uuid` char(36) DEFAULT NULL,
`matter_uuid` char(36) DEFAULT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_dashboard` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`invoke_num` bigint(20) NOT NULL,
`total_invoke_num` bigint(20) NOT NULL DEFAULT '0',
`uv` bigint(20) NOT NULL DEFAULT '0',
`total_uv` bigint(20) NOT NULL DEFAULT '0',
`matter_num` bigint(20) NOT NULL DEFAULT '0',
`total_matter_num` bigint(20) NOT NULL DEFAULT '0',
`file_size` bigint(20) NOT NULL DEFAULT '0',
`total_file_size` bigint(20) NOT NULL DEFAULT '0',
`avg_cost` bigint(20) NOT NULL DEFAULT '0',
`dt` varchar(45) NOT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`),
KEY `idx_dt` (`dt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_download_token` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`user_uuid` char(36) NOT NULL,
`matter_uuid` char(36) NOT NULL,
`expire_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`ip` varchar(128) NOT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`),
KEY `idx_mu` (`matter_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_footprint` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`user_uuid` char(36) DEFAULT NULL,
`ip` varchar(128) NOT NULL,
`host` varchar(45) NOT NULL,
`uri` varchar(255) NOT NULL,
`params` text CHARACTER SET utf8,
`cost` bigint(20) NOT NULL DEFAULT '0',
`success` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_image_cache` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`name` varchar(255) NOT NULL,
`user_uuid` char(36) DEFAULT NULL,
`username` varchar(45) NOT NULL,
`matter_uuid` char(36) DEFAULT NULL,
`matter_name` varchar(255) NOT NULL,
`mode` varchar(512) DEFAULT NULL,
`md5` varchar(45) DEFAULT NULL,
`size` bigint(20) NOT NULL DEFAULT '0',
`path` varchar(512) DEFAULT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`),
KEY `idx_mu` (`matter_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_matter` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`puuid` char(36) DEFAULT NULL,
`user_uuid` char(36) DEFAULT NULL,
`username` varchar(45) NOT NULL,
`dir` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`md5` varchar(45) DEFAULT NULL,
`size` bigint(20) NOT NULL DEFAULT '0',
`privacy` tinyint(1) NOT NULL DEFAULT '0',
`path` varchar(1024) DEFAULT NULL,
`times` bigint(20) NOT NULL DEFAULT '0',
`prop` varchar(1024) NOT NULL DEFAULT '{}',
`visit_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
`delete_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`),
KEY `idx_puuid` (`puuid`),
KEY `idx_uu` (`user_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_preference` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`name` varchar(45) DEFAULT NULL,
`logo_url` varchar(255) DEFAULT NULL,
`favicon_url` varchar(255) DEFAULT NULL,
`copyright` varchar(1024) DEFAULT NULL,
`record` varchar(1024) DEFAULT NULL,
`allow_register` tinyint(1) NOT NULL DEFAULT '0',
`download_dir_max_size` bigint(20) NOT NULL DEFAULT '-1',
`download_dir_max_num` bigint(20) NOT NULL DEFAULT '-1',
`default_total_size_limit` bigint(20) NOT NULL DEFAULT '-1',
`preview_config` text,
`scan_config` text,
`deleted_keep_days` bigint(20) NOT NULL DEFAULT '7',
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_session` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`user_uuid` char(36) DEFAULT NULL,
`ip` varchar(128) NOT NULL,
`expire_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_share` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`name` varchar(255) DEFAULT NULL,
`share_type` varchar(45) DEFAULT NULL,
`username` varchar(45) DEFAULT NULL,
`user_uuid` char(36) DEFAULT NULL,
`download_times` bigint(20) NOT NULL DEFAULT '0',
`code` varchar(45) NOT NULL,
`expire_infinity` tinyint(1) NOT NULL DEFAULT '0',
`expire_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_upload_token` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`user_uuid` char(36) NOT NULL,
`folder_uuid` char(36) NOT NULL,
`matter_uuid` char(36) NOT NULL,
`expire_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`filename` varchar(255) NOT NULL,
`privacy` tinyint(1) NOT NULL DEFAULT '0',
`size` bigint(20) NOT NULL DEFAULT '0',
`ip` varchar(128) NOT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tank31_user` (
`uuid` char(36) NOT NULL,
`sort` bigint(20) NOT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`role` varchar(45) DEFAULT NULL,
`username` varchar(45) NOT NULL,
`password` varchar(255) DEFAULT NULL,
`avatar_url` varchar(255) DEFAULT NULL,
`last_ip` varchar(128) DEFAULT NULL,
`last_time` timestamp NOT NULL DEFAULT '2018-01-01 00:00:00',
`size_limit` bigint(20) NOT NULL DEFAULT '-1',
`total_size_limit` bigint(20) NOT NULL DEFAULT '-1',
`total_size` bigint(20) NOT NULL DEFAULT '0',
`status` varchar(45) DEFAULT NULL,
PRIMARY KEY (`uuid`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193