-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: paydb
-- ------------------------------------------------------
-- 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 */;

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 `orderinfo`
--

DROP TABLE IF EXISTS `orderinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orderinfo` (
  `idx` bigint  NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_id` varchar(255) DEFAULT '' COMMENT 'account_id',
  `orderid` varchar(255) DEFAULT '' COMMENT '订单id',
  `roleid` varchar(255) DEFAULT '' COMMENT '角色id',
  `server_id` int(11) NOT NULL DEFAULT '0' COMMENT 'server_id',
  `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
  `poly_sdk_channel` int(11) NOT NULL DEFAULT '0' COMMENT 'poly_sdk_channel',
  `unified_channel` int(11) NOT NULL DEFAULT '0' COMMENT 'unified_channel',
  `gameid` int(11) NOT NULL DEFAULT '0' COMMENT 'gameid',
  `openid` varchar(255) NOT NULL DEFAULT '0' COMMENT '平台openid',
  `itemid` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
  `try_count` int(11) NOT NULL DEFAULT '0' COMMENT '补单次数',
  `price` int(11) NOT NULL DEFAULT '0' COMMENT 'price',
  `ipv4` varchar(50) NOT NULL DEFAULT '' COMMENT 'ipv4地址',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 新添加订单 1:已经完成订单',
  `confirmtime` int(11) NOT NULL DEFAULT '0' COMMENT 'GameServer订单确认时间',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',

  `sp_orderid` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '平台的订单id',
  `sp_amount` int(11) NOT NULL DEFAULT '0' COMMENT 'sp_amount',
  `sp_confirmtime` int(11) NOT NULL DEFAULT '0' COMMENT '平台确认时间',
  `sp_pay_result` int(11) NOT NULL DEFAULT '0' COMMENT '0: 未确认 1: 支付成功 -1:支付失败',

  PRIMARY KEY (`idx`),
  UNIQUE KEY `orderid` (`orderid`),
  KEY `account_id` (`account_id`),
  KEY `roleid` (`roleid`),
  KEY `server_id` (`server_id`),
  KEY `openid` (`openid`),
  KEY `channel` (`channel`),
  KEY `unified_channel` (`unified_channel`),
  KEY `createtime` (`createtime`),
  KEY `sp_confirmtime` (`sp_confirmtime`),
  KEY `sp_orderid` (`sp_orderid`),
  KEY `gameid` (`gameid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `receipt`
--

DROP TABLE IF EXISTS `receipt`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `receipt` (
  `idx` bigint  NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `receipt_id` varchar(255) NOT NULL DEFAULT '' COMMENT '票据id',
  `orderid` varchar(255) DEFAULT '' COMMENT '订单id',
  `account_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'account_id',
  `roleid` varchar(255) NOT NULL DEFAULT '' COMMENT '角色id',
  `server_id ` int(11) NOT NULL DEFAULT '0' COMMENT 'server_id',
  `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
  `gameid` int(11) NOT NULL DEFAULT '0' COMMENT 'gameid',
  `itemid` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
  `ipv4` varchar(50) NOT NULL DEFAULT '' COMMENT 'ipv4地址',
  `receipt_data` mediumblob COMMENT '票据信息',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',

  PRIMARY KEY (`idx`),
  UNIQUE KEY `receipt_id` (`receipt_id`),
  KEY `account_id` (`account_id`),
  KEY `roleid` (`roleid`),
  KEY `server_id` (`server_id`),
  KEY `channel` (`channel`),
  KEY `createtime` (`createtime`),
  KEY `gameid` (`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
