-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: accountdb
-- ------------------------------------------------------
-- 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` int(11) 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;

--
-- 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` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid`  varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `user_name`  tinyblob COMMENT '用户名字',
  `avatar_url` varchar(256) NOT NULL DEFAULT '' COMMENT '用户头像',
  `game_times` int(11) NOT NULL COMMENT '游戏场次',
  `win_times`  int(11) NOT NULL COMMENT '胜场',
  `kills`      int(11) NOT NULL COMMENT '所有击杀',
  `harm`       int(11) NOT NULL COMMENT '所有伤害',
  `add_HP`     int(11) NOT NULL COMMENT '所有治疗量',
  `alive_time` int(11) NOT NULL COMMENT '所有生存时间',
  `coin_num`   bigint NOT NULL COMMENT '角色金币',
  `integral`   bigint NOT NULL COMMENT '角色积分',
  `kill_his`   int(11) NOT NULL COMMENT '最高击杀',
  `alive_time_his` int(11) NOT NULL COMMENT '最长生存时间',
  `harm_his`   int(11) NOT NULL COMMENT '最高伤害',
  `add_HP_his` int(11) NOT NULL COMMENT '最多治疗量',
  `act_share_status` int(11) NOT NULL COMMENT '分享好礼活动状态',
  `act_share_time` int(11) NOT NULL COMMENT '分享好礼活动时间',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  `first_fight`   int(11) NOT NULL COMMENT '是否是第一次战斗',
  `collect_status` int(11) NOT NULL COMMENT '收藏状态',
  `keys_num`    int(11) NOT NULL DEFAULT '0' COMMENT '钥匙数量',
  `battle_re_times` int(11) NOT NULL DEFAULT '0' COMMENT '每日战斗奖励次数',
  `shop_flush_times` int(11) NOT NULL DEFAULT '0' COMMENT '每日商店刷新次数',
  `kefu_status`  int(11)  NOT NULL DEFAULT '0' COMMENT '客服奖励状态(0:未领取,1:已领取)',
  `sign_sum`   int(11)    NOT NULL DEFAULT '0' COMMENT '签到总天数',
  `box_num`  int(11) NOT NULL DEFAULT '0' COMMENT '空投宝箱数量',
  `diamond_num` bigint NOT NULL DEFAULT '0' COMMENT '钻石数量',
  `diamond_shop_flush_times` int(11) NOT NULL DEFAULT '0' COMMENT '每日钻石商店刷新次数',
  `sum_coin` double NOT NULL DEFAULT '0' COMMENT '累计充值金额',
  `recharge_times_total` int(11) NOT NULL DEFAULT '0' COMMENT '累计充值次数',
  `pass_status` int(11) NOT NULL DEFAULT '0' COMMENT '通行证购买状态',
  `score`     int(11) NOT NULL DEFAULT '0' COMMENT '通行证积分',
  `season_status` int(11) NOT NULL DEFAULT '0' COMMENT '赛季奖励状态',
  `first_gift` int(11) NOT NULL DEFAULT '0' COMMENT '首充礼包领取状态',
  `season_time` int(11) NOT NULL DEFAULT '0' COMMENT '赛季结束时间',
  `free_coin`    int(11) NOT NULL DEFAULT '0' COMMENT '每日免费金币',
  `free_diamond` int(11) NOT NULL DEFAULT '0' COMMENT '每日免费钻石',
  `season_end_score` int(11) NOT NULL DEFAULT '0' COMMENT '赛季结算积分',
  `kill_modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '击杀更新时间',
  `win_modifytime`  int(11) NOT NULL DEFAULT '0' COMMENT '胜场更新时间',
  `rank_modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '排位积分更新时间',
  `vip_score`  int(11)  NOT NULL DEFAULT '0' COMMENT 'vip积分',
  `first_login` int(11) NOT NULL DEFAULT '0' COMMENT '是否第一次登陆',
  `daily_first_login` int(11) NOT NULL DEFAULT '0' COMMENT '每天是否第一次登陆',
  `daily_time` int(11) NOT NULL DEFAULT '0' COMMENT '每日刷新时间',
  `free_box` int(11) NOT NULL DEFAULT '0' COMMENT '每日免费宝箱',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Table structure for table `skin`
--

DROP TABLE IF EXISTS `skin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `skin` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `skin_id` int(11) NOT NULL COMMENT '皮肤id',
  `skin_status` int(11) NOT NULL COMMENT '皮肤状态（0:上阵中,1:已获得）',
  `fragment_id` int(11) NOT NULL COMMENT '碎片id',
  `fragment_num` int(11) NOT NULL COMMENT '碎片数量',
  `active_time` varchar(50) NOT NULL DEFAULT '有效时间（体验时间）',
  `fragment_status` int(11) NOT NULL COMMENT '碎片收集状态（活动相关）',
  `skin_type` int(11) NOT NULL COMMENT '皮肤类型',
  `skin_level` int(11) NOT NULL COMMENT '皮肤等级',
  `skin_experience_level` int(11) NOT NULL COMMENT '皮肤体验等级',
  `skin_experience_type` int(11) NOT NULL COMMENT '皮肤试用类型(0:没试用,1:皮肤体验,2:满级体验)',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `skin_uuid` (`accountid`, `skin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structure for table `equip`
--

DROP TABLE IF EXISTS `equip`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `equip` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `equip_id` int(11) NOT NULL COMMENT '装备id',
  `equip_level` int(11) NOT NULL COMMENT '装备等级',
  `equip_experience_level` int(11) NOT NULL COMMENT '装备体验等级',
  `active_time` varchar(50) NOT NULL DEFAULT '有效时间',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `equip_uuid` (`accountid`, `equip_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structure for table `supplybox`
--

DROP TABLE IF EXISTS `supplybox`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `supplybox` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `box_id` int(11) NOT NULL COMMENT '补给箱id',
  `buy_times` int(11) NOT NULL COMMENT  '购买次数',
  `free_times` int(11) NOT NULL COMMENT '免费获得次数',
  `last_buy_time` varchar(50) NOT NULL DEFAULT '最后一次购买',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `box_uuid` (`accountid`, `box_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structure for table `sign`
--

DROP TABLE IF EXISTS `sign`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `sign` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `sign_id` int(11) NOT NULL DEFAULT '0' COMMENT '补签id',
  `signable` int(11) NOT NULL DEFAULT '0' COMMENT '是否签到',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  `sign_time` int(11) NOT NULL DEFAULT '0' COMMENT '签到时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `account_sign_id` (`accountid`, `sign_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structure for table `hang`
--

DROP TABLE IF EXISTS `hang`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `hang` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `hang_time` varchar(50) NOT NULL DEFAULT '领取时间',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structrure for table `quest`
--

DROP TABLE IF EXISTS `quest`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `quest` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `quest_id` int(11) NOT NULL COMMENT '任务id',
  `quest_num` int(11) NOT NULL COMMENT '任务进度',
  `quest_type` int(11) NOT NULL COMMENT '任务类型',
  `quest_state` int(11) NOT NULL COMMENT '任务状态',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `quest_uuid` (`accountid`, `quest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Table structrure for table `active`
--

DROP TABLE IF EXISTS `active`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `active` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `active_num` int(11) NOT NULL COMMENT '日活跃度',
  `num_time` varchar(50) NOT NULL DEFAULT '日活跃度时间',
  `active_sum` int(11) NOT NULL COMMENT '周活跃度',
  `sum_time` varchar(50) NOT NULL DEFAULT '周活跃度时间',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Table structrure for table `history_record`
--

DROP TABLE IF EXISTS `history_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `history_record`(
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid`  varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `room_uuid`  varchar(60) NOT NULL DEFAULT '' COMMENT '战斗id',
  `map_id`     int(11) NOT NULL COMMENT '地图id',
  `map_tpl_name` varchar(50) NOT NULL DEFAULT '' COMMENT '地图模板名字',
  `map_name`   varchar(50) DEFAULT '' COMMENT '地图名字',
  `game_time`  int(11) NOT NULL COMMENT '游戏完成时间',
  `rank`       int(11) NOT NULL COMMENT '游戏排名',
  `kills`      int(11) NOT NULL COMMENT '游戏击杀',
  `harms`      int(11) NOT NULL COMMENT '游戏伤害',
  `hurts`      int(11) NOT NULL COMMENT '承受伤害',
  `alive_time` int(11) NOT NULL COMMENT '游戏生存时间',
  `coin`       bigint  NOT NULL COMMENT '战斗结算金币',
  `status`     int(11) NOT NULL COMMENT '结算金币领取状态',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `history_record_uuid` (`accountid`, `room_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Table structure for table `share_achievement`
--

DROP TABLE IF EXISTS `share_achievement`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `share_achievement` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `ach_id` int(11) NOT NULL COMMENT '分享邀请成就id',
  `status` int(11) NOT NULL COMMENT '状态(0:未领取,1:已领取)',
  `create_time`   int(11) NOT NULL COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid_ach_id` (`accountid`, `ach_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `activity`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `free_times` int(11) NOT NULL DEFAULT '0' COMMENT '免费抽奖次数',
  `video_times` int(11) NOT NULL DEFAULT '0' COMMENT '视频抽奖次数',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
  `item_num` int(11) NOT NULL DEFAULT '0' COMMENT '物品数量',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `buy_his`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `buy_his` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `itemid` int(11) NOT NULL DEFAULT '0' COMMENT 'itemid',
  `sum_times` int(11) NOT NULL DEFAULT '0' COMMENT '累计充值次数',
  `today_times` int(11) NOT NULL DEFAULT '0' COMMENT '今日充值次数',
  `last_buy_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后购买时间',
  `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  KEY `accountid` (`accountid`),
  UNIQUE KEY `accountid_itemid` (`accountid`, `itemid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `orderinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orderinfo` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `orderid` varchar(60) DEFAULT '' COMMENT '订单id',
  `itemid` int(11) NOT NULL DEFAULT '0' COMMENT 'itemid',
  `coin` double NOT NULL DEFAULT '0' COMMENT '充值金额',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 新添加订单 1:已经完成订单',
  `item_list` mediumblob COMMENT 'item_list',
  `confirmtime` int(11) NOT NULL DEFAULT '0' COMMENT 'GameServer订单确认时间',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `orderid` (`orderid`),
  KEY `accountid` (`accountid`),
  KEY `accountid_itemid` (`accountid`, `itemid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `vipinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vipinfo` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `vipid` int(11) NOT NULL DEFAULT '0' COMMENT 'vipid',
  `reward_id` int(11) NOT NULL DEFAULT '0' COMMENT '奖励id',
  `reward_status` int(11) NOT NULL DEFAULT '0' COMMENT '奖励状态',
  `today_reward_id` int(11) NOT NULL DEFAULT '0' COMMENT '今日奖励id',
  `today_reward_status` int(11) NOT NULL DEFAULT '0' COMMENT '今日奖励状态',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  KEY `accountid` (`accountid`),
  UNIQUE KEY `accountid_vipid` (`accountid`, `vipid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `passinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `passinfo` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `passid` int(11) NOT NULL DEFAULT '0' COMMENT 'passid',
  `active_status` int(11) NOT NULL DEFAULT '0' COMMENT '普通奖励状态',
  `honor_status` int(11) NOT NULL DEFAULT '0' COMMENT '荣耀奖励状态',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  KEY `accountid` (`accountid`),
  UNIQUE KEY `accountid_passid` (`accountid`, `passid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `emoji`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `emoji` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
  `emojiid` int(11) NOT NULL DEFAULT '0' COMMENT 'emojiid',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  KEY `accountid` (`accountid`),
  UNIQUE KEY `accountid_emojiid` (`accountid`, `emojiid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `redpack`;
/*!40101 SET @saved_cs_client     = @@character_set_client*/;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `redpack` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `red_type` int(11) NOT NULL DEFAULT '0' COMMENT '红包类型(1:红包雨红包,2:邀请好友红包)',
  `red_sum` double NOT NULL DEFAULT '0' COMMENT '红包金额(已发放的)',
  `red_date` int(11) NOT NULL DEFAULT '0' COMMENT '日期（某天时间的00:00:00）',
  `create_time`   int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modify_time`   int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `red_type_red_date` (`red_type`, `red_date`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `redpack_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `redpack_log` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `order_id` varchar(60) DEFAULT '' COMMENT '订单id',
  `get_time` int(11) NOT NULL DEFAULT '0' COMMENT '领取时间',
  `coin_num` int(11) NOT NULL DEFAULT '0' COMMENT '金钱数量',
  `custom_data` mediumblob  COMMENT '其他字段',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `account_order_id_get_time` (`accountid`, `order_id` , `get_time`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `orderidx`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orderidx` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

/*!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:51:22
