-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxviewer.sql
187 lines (166 loc) · 7.32 KB
/
xviewer.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
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
-- MySQL dump 10.16 Distrib 10.1.47-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: xviewer
-- ------------------------------------------------------
-- Server version 10.4.8-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `accounts`
--
DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
`uid` varchar(128) NOT NULL COMMENT '用户名sha256',
`username` varchar(255) NOT NULL COMMENT '用户名',
`password` varchar(128) NOT NULL COMMENT '加盐密码sha256',
`salt` varchar(32) NOT NULL COMMENT '盐值',
`createtime` timestamp NOT NULL DEFAULT current_timestamp(),
`updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `covers`
--
DROP TABLE IF EXISTS `covers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `covers` (
`id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `covers_ibfk_1` FOREIGN KEY (`id`) REFERENCES `objects` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `history`
--
DROP TABLE IF EXISTS `history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `history` (
`watchid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL COMMENT '用户名',
`host` varchar(255) NOT NULL DEFAULT '' COMMENT '访问地址',
`id` varchar(255) NOT NULL DEFAULT '' COMMENT '视频ID',
`watchtime` int(11) NOT NULL DEFAULT 0,
`createtime` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '访问时间',
`updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`watchid`)
) ENGINE=InnoDB AUTO_INCREMENT=1126 DEFAULT CHARSET=utf8 COMMENT='用户访问日志';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `objects`
--
DROP TABLE IF EXISTS `objects`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `objects` (
`id` varchar(255) NOT NULL,
`filename` varchar(255) NOT NULL,
`mtime` datetime NOT NULL,
`fsize` bigint(20) NOT NULL,
`createtime` timestamp NOT NULL DEFAULT current_timestamp(),
`updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tickets`
--
DROP TABLE IF EXISTS `tickets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tickets` (
`tid` varchar(128) NOT NULL COMMENT 'TicketID',
`uid` varchar(128) NOT NULL COMMENT '用户名sha256',
`createtime` timestamp NOT NULL DEFAULT current_timestamp(),
`expiretime` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='凭据表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userfav`
--
DROP TABLE IF EXISTS `userfav`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userfav` (
`uid` varchar(128) NOT NULL COMMENT '用户名sha256',
`id` varchar(255) NOT NULL COMMENT '视频id',
`createtime` timestamp NOT NULL DEFAULT current_timestamp(),
`updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`uid`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary table structure for view `videocheck`
--
DROP TABLE IF EXISTS `videocheck`;
/*!50001 DROP VIEW IF EXISTS `videocheck`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `videocheck` (
`id` tinyint NOT NULL,
`cid` tinyint NOT NULL,
`filename` tinyint NOT NULL,
`watchcount` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `videos`
--
DROP TABLE IF EXISTS `videos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `videos` (
`id` varchar(255) NOT NULL,
`coverid` varchar(255) DEFAULT NULL,
`videotime` int(11) NOT NULL DEFAULT 0,
`watchcount` int(11) NOT NULL DEFAULT 0,
`watchtime` int(11) NOT NULL DEFAULT 0,
`uploader` varchar(255) NOT NULL DEFAULT '',
`tags` text DEFAULT NULL,
`createtime` timestamp NOT NULL DEFAULT current_timestamp(),
`updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `coverid` (`coverid`),
CONSTRAINT `videos_ibfk_1` FOREIGN KEY (`id`) REFERENCES `objects` (`id`),
CONSTRAINT `videos_ibfk_2` FOREIGN KEY (`coverid`) REFERENCES `objects` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Final view structure for view `videocheck`
--
/*!50001 DROP TABLE IF EXISTS `videocheck`*/;
/*!50001 DROP VIEW IF EXISTS `videocheck`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `videocheck` AS select `videos`.`id` AS `id`,`videos`.`coverid` AS `cid`,`objects`.`filename` AS `filename`,`videos`.`watchcount` AS `watchcount` from (`videos` join `objects` on(`videos`.`id` = `objects`.`id`)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-03-21 10:57:25