begin;

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;

insert into version (version) values(2020043001);

commit;
