-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: relationdb
-- ------------------------------------------------------
-- Server version	5.5.41-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `version`
--

DROP TABLE IF EXISTS `version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `version` (
  `idx` bigint  NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `version` int(11) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `version` (`version`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
  `idx` bigint  NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id',
  `nickname` tinyblob COMMENT 'nickname',
  `avatar_url` varchar(256) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '',
  `sex` int(11) NOT NULL DEFAULT '0' COMMENT 'sex',
  `friend_data` mediumblob COMMENT '好友数据',
  `data_version1` bigint NOT NULL DEFAULT '0' COMMENT 'data_version1',
  `user_value1` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value1',
  `user_value2` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value2',
  `user_value3` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value3',
  `guild_id` bigint NOT NULL COMMENT '工会id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  `registertime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `last_logintime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `account_id` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

-- Table structure for table `group`
--

DROP TABLE IF EXISTS `group`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `group` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `group_id` bigint NOT NULL COMMENT 'group_id',
  `group_name` tinyblob COMMENT 'group_name',
  `owner_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '群主',
  `creator_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '群创建者',
  `group_data` mediumblob COMMENT '群数据',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `group_id` (`group_id`),
  KEY `owner_id` (`owner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

-- Table structure for table `guild`
--

DROP TABLE IF EXISTS `guild`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `guild` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `guild_id` bigint NOT NULL COMMENT '公会id',
  `guild_name` tinyblob COMMENT '公会名字',
  `guild_lv` int(11) NOT NULL DEFAULT '0' COMMENT '公会等级',
  `guild_exp` int(11) NOT NULL DEFAULT '0' COMMENT '公会经验',
  `guild_badge` int(11) NOT NULL DEFAULT '0' COMMENT '公会徽章',
  `guild_apply_num` int(11) NOT NULL DEFAULT '0' COMMENT '申请人数',
  `guild_administers` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会管理员',
  `guild_notice` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会公告',
  `guild_declaration` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会宣言',
  `guild_log` mediumblob COMMENT '公会日志',
  `owner_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会主',
  `creator_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会创建者',
  `guild_data` mediumblob COMMENT '公会数据',
  `guild_status` int(11) NOT NULL DEFAULT '0' COMMENT '公会状态 0:新建（未确认） 1:已确认 2:已解散',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `guild_id` (`guild_id`),
  KEY `owner_id` (`owner_id`),
  KEY `creator_id` (`creator_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

-- Table structure for table `friend_apply`
--

DROP TABLE IF EXISTS `friend_apply`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `friend_apply` (
  `idx` bigint  NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `applyid` bigint NOT NULL COMMENT 'applyid',
  `target_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'target',
  `sender_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'sender',
  `sender_nickname` tinyblob COMMENT 'nickname',
  `sender_avatar_url` varchar(256) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '',
  `sender_sex` int(11) NOT NULL DEFAULT '0' COMMENT 'sex',
  `sender_data_version1` int(11) NOT NULL DEFAULT '0' COMMENT 'data_version1',
  `sender_user_value1` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value1',
  `sender_user_value2` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value2',
  `sender_user_value3` bigint  NOT NULL DEFAULT '0' COMMENT 'user_value3',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:未处理 1:同意 2：拒绝 3：忽略',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `applyid` (`applyid`),
  KEY `target_id` (`target_id`),
  KEY `sender_id` (`sender_id`),
  KEY `target_sender` (`target_id`, `sender_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

-- Table structure for table `event`
--

DROP TABLE IF EXISTS `event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `event` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `sender_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '事件发送方id',
  `target_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '事件接受方id',
  `event_name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '事件名',
  `param1` tinyblob COMMENT 'param1',
  `param2` tinyblob COMMENT 'param2',
  `param3` tinyblob COMMENT 'param3',
  `event_data` mediumblob COMMENT '事件数据',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:未处理 1:已处理',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`idx`),
  KEY `sender_id` (`sender_id`),
  KEY `target_id` (`target_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-08-19 18:52:06
