-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: kefudb
-- ------------------------------------------------------
-- 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;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `accounts`
--

DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `channel` int(11) NOT NULL COMMENT 'channel',
  `gameid` int(11) NOT NULL COMMENT 'gameid',
  `openid` varchar(50) NOT NULL COMMENT '平台',
  `awardtime` int(11) NOT NULL DEFAULT '0' COMMENT '最后领奖时间',
  `activetime` int(11) NOT NULL DEFAULT '0' COMMENT '最后交互时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`),
  UNIQUE KEY `channel_gameid_openid_index` (`channel`,`gameid`,`openid`),
  KEY `openid_index` (`openid`),
  KEY `channel_index` (`channel`),
  KEY `gameid_index` (`gameid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;



DROP TABLE IF EXISTS `subscribe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscribe` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `channel` int(11) NOT NULL COMMENT 'channel',
  `gameid` int(11) NOT NULL COMMENT 'gameid',
  `openid` varchar(50) NOT NULL COMMENT '平台',
  `signorder` int(11) NOT NULL DEFAULT '0' COMMENT '是否订阅签到',
  `boxorder` int(11) NOT NULL DEFAULT '0' COMMENT '是否订阅宝箱',
  `diaorder` int(11) NOT NULL DEFAULT '0' COMMENT '是否订阅钻石',
  `seaorder` int(11) NOT NULL DEFAULT '0' COMMENT '是否订阅赛季',
  `signtime` int(11) NOT NULL DEFAULT '0' COMMENT '最后签到订阅时间',
  `boxtime` int(11) NOT NULL DEFAULT '0' COMMENT '最后宝箱订阅时间',
  `diatime` int(11) NOT NULL DEFAULT '0' COMMENT '最后钻石订阅时间',
  `seatime` int(11) NOT NULL DEFAULT '0' COMMENT '最后赛季订阅时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `accountid` (`accountid`),
  UNIQUE KEY `channel_gameid_openid_index` (`channel`,`gameid`,`openid`),
  KEY `openid_index` (`openid`),
  KEY `channel_index` (`channel`),
  KEY `gameid_index` (`gameid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;


/*!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
