text: -- 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
  