text: /*
   Navicat Premium Data Transfer
  
   Source Server         : 本地
   Source Server Type    : MySQL
   Source Server Version : 50554
   Source Host           : localhost:3306
   Source Schema         : java
  
   Target Server Type    : MySQL
   Target Server Version : 50554
   File Encoding         : 65001
  
   Date: 05/07/2018 19:54:55
  */
  
  SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  -- Table structure for address
  -- ----------------------------
  DROP TABLE IF EXISTS `address`;
  CREATE TABLE `address`  (
    `uid` int(11) NOT NULL,
    `ipv4` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    `ipv6` varchar(39) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    `port` int(5) UNSIGNED NULL DEFAULT NULL,
    PRIMARY KEY (`uid`) USING BTREE,
    UNIQUE INDEX `uid`(`uid`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for friendship
  -- ----------------------------
  DROP TABLE IF EXISTS `friendship`;
  CREATE TABLE `friendship`  (
    `uid` int(11) UNSIGNED NOT NULL,
    `friendId` int(11) UNSIGNED NOT NULL,
    INDEX `uid`(`uid`) USING BTREE,
    INDEX `friendId`(`friendId`) USING BTREE,
    CONSTRAINT `friendId` FOREIGN KEY (`friendId`) REFERENCES `user` (`uid`) ON DELETE RESTRICT ON UPDATE RESTRICT,
    CONSTRAINT `uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for user
  -- ----------------------------
  DROP TABLE IF EXISTS `user`;
  CREATE TABLE `user`  (
    `uid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `nickName` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
    `password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    `slat` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    PRIMARY KEY (`uid`) USING BTREE,
    UNIQUE INDEX `uid`(`uid`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  
  SET FOREIGN_KEY_CHECKS = 1;
  