text: /*
  Navicat MySQL Data Transfer
  
  Source Server         : lidegui
  Source Server Version : 50718
  Source Host           : localhost:3306
  Source Database       : little_drawer
  
  Target Server Type    : MYSQL
  Target Server Version : 50718
  File Encoding         : 65001
  
  Date: 2019-05-06 22:07:33
  */
  
  SET FOREIGN_KEY_CHECKS=0;
  
  -- ----------------------------
  -- Table structure for collection
  -- ----------------------------
  DROP TABLE IF EXISTS `collection`;
  CREATE TABLE `collection` (
    `cl_id` int(11) NOT NULL AUTO_INCREMENT,
    `date` datetime DEFAULT NULL,
    `topic_type` int(11) DEFAULT NULL,
    `topic_id` int(11) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`cl_id`),
    KEY `topic_id` (`topic_id`),
    KEY `user_id` (`user_id`),
    CONSTRAINT `collection_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for comment
  -- ----------------------------
  DROP TABLE IF EXISTS `comment`;
  CREATE TABLE `comment` (
    `c_id` int(11) NOT NULL AUTO_INCREMENT,
    `content` text NOT NULL,
    `date` datetime DEFAULT NULL,
    `topic_type` int(255) DEFAULT NULL,
    `user_id` int(11) NOT NULL,
    `topic_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`c_id`),
    KEY `user_id` (`user_id`),
    KEY `topic_id` (`topic_id`),
    CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for file
  -- ----------------------------
  DROP TABLE IF EXISTS `file`;
  CREATE TABLE `file` (
    `f_id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `mime` varchar(255) DEFAULT NULL,
    `path` varchar(255) DEFAULT '',
    `date` datetime DEFAULT NULL,
    `media_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`f_id`),
    KEY `media_id` (`media_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for like
  -- ----------------------------
  DROP TABLE IF EXISTS `like`;
  CREATE TABLE `like` (
    `l_id` int(11) NOT NULL AUTO_INCREMENT,
    `date` datetime DEFAULT NULL,
    `status` int(11) DEFAULT NULL,
    `topic_type` int(11) DEFAULT NULL,
    `topic_id` int(11) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`l_id`),
    KEY `user_id` (`user_id`),
    KEY `topic_id` (`topic_id`),
    CONSTRAINT `like_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for news
  -- ----------------------------
  DROP TABLE IF EXISTS `news`;
  CREATE TABLE `news` (
    `n_id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    `column` varchar(255) DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `content` text,
    `style` int(11) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`n_id`),
    KEY `news_ibfk_1` (`user_id`),
    CONSTRAINT `news_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=785 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for picture
  -- ----------------------------
  DROP TABLE IF EXISTS `picture`;
  CREATE TABLE `picture` (
    `p_id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    `url` varchar(255) DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `topic_type` int(11) DEFAULT NULL,
    `topic_id` int(11) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    `content` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`p_id`),
    KEY `topic_id` (`topic_id`),
    KEY `user_id` (`user_id`),
    CONSTRAINT `picture_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for reply
  -- ----------------------------
  DROP TABLE IF EXISTS `reply`;
  CREATE TABLE `reply` (
    `r_id` int(11) NOT NULL AUTO_INCREMENT,
    `content` varchar(255) DEFAULT NULL,
    `reply_type` int(11) DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `comment_id` int(11) DEFAULT NULL,
    `reply_id` int(11) DEFAULT NULL,
    `from_user_id` int(11) DEFAULT NULL,
    `to_user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`r_id`),
    KEY `from_user_id` (`from_user_id`),
    KEY `comment_id` (`comment_id`),
    KEY `to_user_id` (`to_user_id`),
    KEY `reply_id` (`reply_id`),
    CONSTRAINT `reply_ibfk_1` FOREIGN KEY (`from_user_id`) REFERENCES `user` (`u_id`),
    CONSTRAINT `reply_ibfk_2` FOREIGN KEY (`comment_id`) REFERENCES `comment` (`c_id`),
    CONSTRAINT `reply_ibfk_3` FOREIGN KEY (`to_user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for report
  -- ----------------------------
  DROP TABLE IF EXISTS `report`;
  CREATE TABLE `report` (
    `re_id` int(11) NOT NULL AUTO_INCREMENT,
    `reason` varchar(255) DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `topic_name` varchar(255) DEFAULT NULL,
    `topic_id` int(11) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`re_id`),
    KEY `user_id` (`user_id`),
    CONSTRAINT `report_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for user
  -- ----------------------------
  DROP TABLE IF EXISTS `user`;
  CREATE TABLE `user` (
    `u_id` int(11) NOT NULL AUTO_INCREMENT,
    `nick_name` varchar(255) NOT NULL,
    `username` varchar(255) DEFAULT NULL,
    `password` varchar(255) DEFAULT NULL,
    `icon_url` varchar(255) DEFAULT NULL,
    `token` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
  
  -- ----------------------------
  -- Table structure for video
  -- ----------------------------
  DROP TABLE IF EXISTS `video`;
  CREATE TABLE `video` (
    `v_id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    `describe` varchar(255) DEFAULT NULL,
    `click` int(11) DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `type_index` int(11) DEFAULT NULL,
    `type_name` varchar(255) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`v_id`),
    KEY `user_id` (`user_id`),
    CONSTRAINT `video_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`u_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
  