text: SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  -- Table structure for admin
  -- ----------------------------
  DROP TABLE IF EXISTS `admin`;
  CREATE TABLE `admin`  (
    `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '管理员名称',
    `head` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `sign` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `account_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    PRIMARY KEY (`account_id`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Records of admin
  -- ----------------------------
  INSERT INTO `admin` VALUES ('admin', NULL, '自由不是做你想做的事，而是可以不做你不想做的。', 'f6fdffe48c908deb0f4c3bd36c032e72', 'admin');
  
  -- ----------------------------
  -- Table structure for comment
  -- ----------------------------
  DROP TABLE IF EXISTS `comment`;
  CREATE TABLE `comment`  (
    `id` int(25) NOT NULL AUTO_INCREMENT,
    `content_id` int(25) NOT NULL,
    `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0),
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for content
  -- ----------------------------
  DROP TABLE IF EXISTS `content`;
  CREATE TABLE `content`  (
    `id` int(50) NOT NULL AUTO_INCREMENT,
    `detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `label_id` int(20) NOT NULL,
    `read_count` int(50) NULL DEFAULT 0,
    `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0),
    `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `content_type` int(2) NULL DEFAULT 0 COMMENT '文本的类型0代表富文本，1代表Markdown',
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for info
  -- ----------------------------
  DROP TABLE IF EXISTS `info`;
  CREATE TABLE `info`  (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `comment_id` int(10) NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for labels
  -- ----------------------------
  DROP TABLE IF EXISTS `labels`;
  CREATE TABLE `labels`  (
    `id` int(20) NOT NULL AUTO_INCREMENT,
    `parent_id` int(20) NULL DEFAULT 0,
    `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Records of labels
  -- ----------------------------
  INSERT INTO `labels` VALUES (1, 0, '默认标签');
  INSERT INTO `labels` VALUES (2, 0, 'JAVA');
  INSERT INTO `labels` VALUES (3, 0, 'Html');
  INSERT INTO `labels` VALUES (5, 2, 'JAVA-Web');
  INSERT INTO `labels` VALUES (6, 2, 'Android');
  INSERT INTO `labels` VALUES (7, 3, 'Jquery');
  INSERT INTO `labels` VALUES (8, 3, 'JavaScript');
  INSERT INTO `labels` VALUES (9, 3, 'Bootstrap');
  INSERT INTO `labels` VALUES (10, 2, 'Java_SE');
  
  -- ----------------------------
  -- Table structure for resources
  -- ----------------------------
  DROP TABLE IF EXISTS `resources`;
  CREATE TABLE `resources`  (
    `id` int(20) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
    `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `click_count` int(50) NULL DEFAULT 0,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for setting
  -- ----------------------------
  DROP TABLE IF EXISTS `setting`;
  CREATE TABLE `setting`  (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `config` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    `status` tinyint(1) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for theme
  -- ----------------------------
  DROP TABLE IF EXISTS `theme`;
  CREATE TABLE `theme`  (
    `main_bg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `theme_css` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `theme_js` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    `id` int(1) NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Triggers structure for table content
  -- ----------------------------
  DROP TRIGGER IF EXISTS `delect_`;
  delimiter ;;
  CREATE TRIGGER `delect_` AFTER DELETE ON `content` FOR EACH ROW DELETE  from `comment` 
  where
  content_id = OLD.id
  ;
  ;;
  delimiter ;
  
  -- ----------------------------
  -- Triggers structure for table labels
  -- ----------------------------
  DROP TRIGGER IF EXISTS `delect`;
  delimiter ;;
  CREATE TRIGGER `delect` AFTER DELETE ON `labels` FOR EACH ROW update content set label_id = 1 
  where label_id=OLD.id
  ;
  ;;
  delimiter ;
  
  SET FOREIGN_KEY_CHECKS = 1;
  