text: /*
   Navicat Premium Data Transfer
  
   Source Server         : localhost_3306
   Source Server Type    : MySQL
   Source Server Version : 80021
   Source Host           : localhost:3306
   Source Schema         : friend
  
   Target Server Type    : MySQL
   Target Server Version : 80021
   File Encoding         : 65001
  
   Date: 05/07/2021 16:59:02
  */
  
  SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  -- Table structure for chat_record
  -- ----------------------------
  DROP TABLE IF EXISTS `chat_record`;
  CREATE TABLE `chat_record`  (
    `send` int NULL DEFAULT NULL,
    `revicer` int NULL DEFAULT NULL,
    `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `create_time` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    INDEX `fk_from`(`send`) USING BTREE,
    INDEX `fk_to`(`revicer`) USING BTREE,
    CONSTRAINT `fk_from` FOREIGN KEY (`send`) REFERENCES `user` (`u_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
    CONSTRAINT `fk_to` FOREIGN KEY (`revicer`) REFERENCES `user` (`u_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for room
  -- ----------------------------
  DROP TABLE IF EXISTS `room`;
  CREATE TABLE `room`  (
    `r_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
    `is_full` bit(1) NULL DEFAULT NULL,
    PRIMARY KEY (`r_id`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for user
  -- ----------------------------
  DROP TABLE IF EXISTS `user`;
  CREATE TABLE `user`  (
    `u_id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    PRIMARY KEY (`u_id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for user_infor
  -- ----------------------------
  DROP TABLE IF EXISTS `user_infor`;
  CREATE TABLE `user_infor`  (
    `u_id` int NULL DEFAULT NULL,
    `img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `birthday` date NULL DEFAULT NULL,
    `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    INDEX `u_id`(`u_id`) USING BTREE,
    CONSTRAINT `user_infor_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `user` (`u_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  
  SET FOREIGN_KEY_CHECKS = 1;
  