/*
 Navicat Premium Data Transfer

 Source Server         : mysql5
 Source Server Type    : MySQL
 Source Server Version : 50729
 Source Host           : lsmbp.local:3307
 Source Schema         : r2

 Target Server Type    : MySQL
 Target Server Version : 50729
 File Encoding         : 65001

 Date: 17/05/2023 19:43:12
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_blacklist
-- ----------------------------
DROP TABLE IF EXISTS `t_blacklist`;
CREATE TABLE `t_blacklist` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `muid` varchar(64) NOT NULL,
  `buid` varchar(64) NOT NULL,
  PRIMARY KEY (`idx`),
  UNIQUE KEY `black` (`muid`,`buid`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for t_friends
-- ----------------------------
DROP TABLE IF EXISTS `t_friends`;
CREATE TABLE `t_friends` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `muid` varchar(64) NOT NULL,
  `fuid` varchar(64) NOT NULL,
  `apply` int(11) NOT NULL COMMENT '申请状态 0-未通过 2-已通过',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `link_unique` (`muid`,`fuid`) USING HASH COMMENT '一个玩家与另一个玩家只能建立一个连接关系'
) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_guild_chat
-- ----------------------------
DROP TABLE IF EXISTS `t_guild_chat`;
CREATE TABLE `t_guild_chat` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `guild_idx` int(11) NOT NULL,
  `content` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_guild_logs
-- ----------------------------
DROP TABLE IF EXISTS `t_guild_logs`;
CREATE TABLE `t_guild_logs` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `content` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_guild_members
-- ----------------------------
DROP TABLE IF EXISTS `t_guild_members`;
CREATE TABLE `t_guild_members` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `guild_idx` int(11) NOT NULL,
  `uid` varchar(64) NOT NULL,
  `name` varchar(32) DEFAULT NULL,
  `g_rank` int(11) NOT NULL COMMENT '工会官衔 10-会长  5-助理 0-普通成员',
  `apply` int(11) NOT NULL COMMENT '申请状态 0-未通过 2-已通过',
  `chat_g_last` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `guild_idx_uid` (`guild_idx`,`uid`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_guilds
-- ----------------------------
DROP TABLE IF EXISTS `t_guilds`;
CREATE TABLE `t_guilds` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `gname` varchar(48) CHARACTER SET latin1 NOT NULL,
  `logo` varchar(32) DEFAULT NULL COMMENT '工会图标',
  `gowner` varchar(64) NOT NULL,
  `gownername` varchar(32) DEFAULT NULL,
  `gmaxmember` int(11) DEFAULT '100' COMMENT '成员上限',
  `announce` varchar(512) DEFAULT NULL COMMENT '公告内容',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `gname` (`gname`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_users
-- ----------------------------
DROP TABLE IF EXISTS `t_users`;
CREATE TABLE `t_users` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `account` varchar(64) CHARACTER SET latin1 NOT NULL,
  `username` varchar(64) CHARACTER SET latin1 NOT NULL,
  `password` varchar(64) CHARACTER SET latin1 NOT NULL,
  PRIMARY KEY (`idx`),
  UNIQUE KEY `account` (`account`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=utf8;

SET FOREIGN_KEY_CHECKS = 1;
