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

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

DROP TABLE IF EXISTS `t_parameter`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_parameter` (
  `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name',
  `value` mediumblob COMMENT 'value',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_box_order`
--

DROP TABLE IF EXISTS `t_box_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_box_order` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `game_id` int(11) NOT NULL DEFAULT '0' COMMENT 'game id',
  `func_id` int(11) NOT NULL DEFAULT '0' COMMENT 'func_id 1:预售 2:商店',
  `batch_idx` int(11) NOT NULL DEFAULT '0' COMMENT '批次号idx',
  `order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
  `type` varchar(60) NOT NULL DEFAULT '' COMMENT 'type',
  `buyer_address` varchar(60) NOT NULL DEFAULT '' COMMENT '购买者',
  `raw_buyer_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'raw购买者',
  `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price',
  `payment_token_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址',
  `nonce` varchar(60) NOT NULL DEFAULT '' COMMENT 'nonce',
  `signature` varchar(255) NOT NULL DEFAULT '' COMMENT '签名',
  `net_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'net_id',
  `bc_pay_txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'bc_pay_txhash',
  `bc_paid` int(11) NOT NULL DEFAULT '0' COMMENT '是否已支付',
  `bc_pay_count` int(11) NOT NULL DEFAULT '0' COMMENT '支付次数',
  `bc_pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '本节点最后一次支付时间',
  `bc_pay_prepare_block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '支付准备前块id',
  `bc_pay_success_block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '支付成功块id',
  `bc_pay_confirm_time` int(11) NOT NULL DEFAULT '0' COMMENT '支付成功被确认时间',
  `bc_minted1` int(11) NOT NULL DEFAULT '0' COMMENT 'nft是否已创建',
  `bc_mint_txhash1` varchar(255) NOT NULL DEFAULT '' COMMENT 'bc_mint_txhash',
  `bc_mint_tokenid1` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `bc_mint_need1` int(11) NOT NULL DEFAULT '0' COMMENT 'need',
  `bc_mint_itemid1` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `bc_mint_token_type1` int(11) NOT NULL DEFAULT '0' COMMENT 'nft类型 1:英雄 2:枪支 3:芯片',
  `bc_mint_count1` int(11) NOT NULL DEFAULT '0' COMMENT '生成nft次数',
  `bc_mint_time1` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次生成nft时间',
  `bc_mint_prepare_block_number1` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成准备前块id',
  `bc_mint_success_block_number1` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成成功块id',
  `bc_mint_confirm_time1` int(11) NOT NULL DEFAULT '0' COMMENT 'nft生成被确认时间',
  `bc_minted2` int(11) NOT NULL DEFAULT '0' COMMENT 'nft是否已创建',
  `bc_mint_txhash2` varchar(255) NOT NULL DEFAULT '' COMMENT 'bc_mint_txhash',
  `bc_mint_tokenid2` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `bc_mint_need2` int(11) NOT NULL DEFAULT '0' COMMENT 'need',
  `bc_mint_itemid2` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `bc_mint_token_type2` int(11) NOT NULL DEFAULT '0' COMMENT 'nft类型 1:英雄 2:枪支 3:芯片',
  `bc_mint_count2` int(11) NOT NULL DEFAULT '0' COMMENT '生成nft次数',
  `bc_mint_time2` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次生成nft时间',
  `bc_mint_prepare_block_number2` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成准备前块id',
  `bc_mint_success_block_number2` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成成功块id',
  `bc_mint_confirm_time2` int(11) NOT NULL DEFAULT '0' COMMENT 'nft生成被确认时间',
  `bc_minted3` int(11) NOT NULL DEFAULT '0' COMMENT 'nft是否已创建',
  `bc_mint_txhash3` varchar(255) NOT NULL DEFAULT '' COMMENT 'bc_mint_txhash',
  `bc_mint_tokenid3` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `bc_mint_need3` int(11) NOT NULL DEFAULT '0' COMMENT 'need',
  `bc_mint_itemid3` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `bc_mint_token_type3` int(11) NOT NULL DEFAULT '0' COMMENT 'nft类型 1:英雄 2:枪支 3:芯片',
  `bc_mint_count3` int(11) NOT NULL DEFAULT '0' COMMENT '生成nft次数',
  `bc_mint_time3` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次生成nft时间',
  `bc_mint_prepare_block_number3` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成准备前块id',
  `bc_mint_success_block_number3` varchar(60) NOT NULL DEFAULT '' COMMENT 'nft生成成功块id',
  `bc_mint_confirm_time3` int(11) NOT NULL DEFAULT '0' COMMENT 'nft生成被确认时间',
  `suspend` int(11) NOT NULL DEFAULT '0' COMMENT '挂起',
  `suspend_reason` mediumblob COMMENT '挂起原因',
  `done` int(11) NOT NULL DEFAULT '0' COMMENT '是否已完成',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `order_id` (`order_id`),
  UNIQUE KEY `signature` (`signature`),
  KEY `batch_idx` (`batch_idx`),
  KEY `bc_paid` (`bc_paid`),
  KEY `done` (`done`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_nft`
--

DROP TABLE IF EXISTS `t_nft`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_nft` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `token_type` int(11) NOT NULL DEFAULT '0' COMMENT 'nft类型 1:英雄 2:枪支 3:芯片',
  `game_id` int(11) NOT NULL DEFAULT '0' COMMENT 'game id',
  `token_state` int(11) NOT NULL DEFAULT '0' COMMENT '0:正常状态 1:出售中 2:出租中',
  `token_state`  NOT NULL DEFAULT '' COMMENT '0:正常状态 1:出售中 2:出租中',
  `game_id` int(11) NOT NULL DEFAULT '0' COMMENT 'game id',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `owner_address` varchar(255) NOT NULL DEFAULT '' COMMENT 'owner_address',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `token_id` (`token_id`),
  KEY `owner_address_token_type` (`owner_address`, `token_type`),
  KEY `owner_address` (`owner_address`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_buy_record`
--

DROP TABLE IF EXISTS `t_buy_record`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `t_buy_record` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `blobdata` mediumblob COMMENT 'blobdata',
  `buyer_address` mediumblob COMMENT 'buyer_address',
  `order_id` varchar(60) COMMENT '订单id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_block_number`
--

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

--
-- Table structure for table `t_withdrawal`
--

DROP TABLE IF EXISTS `t_withdrawal`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_withdrawal` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account` varchar(255) NOT NULL DEFAULT '' COMMENT 'account',
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '货币类型 1:金币 2：钻石',
  `net_id` int(11) NOT NULL DEFAULT '0' COMMENT 'net_id',
  `amount` varchar(100) NOT NULL DEFAULT '' COMMENT 'amount',
  `state` int(11) NOT NULL DEFAULT '0' COMMENT 'state 0:等待上链 1:上链中2:上链成功 3:提现失败',
  `bc_block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '支付准备前块id',
  `bc_txhash` varchar(255) COMMENT 'bc_txhash',
  `bc_time` int(11) NOT NULL DEFAULT '0' COMMENT '本节点最后一次支付时间',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `bc_txhash` (`bc_txhash`),
  KEY `account` (`account`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_transfer`
--

DROP TABLE IF EXISTS `t_transfer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_transfer` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash',
  `block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '块id',
  `type` int(11) NOT NULL DEFAULT '0' COMMENT 'type',
  `_from` varchar(255) NOT NULL DEFAULT '' COMMENT '_from',
  `_to` varchar(255) NOT NULL DEFAULT '' COMMENT '_to',
  `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value',
  `state` int(11) NOT NULL DEFAULT '0' COMMENT '0:未同步 1:同步成功 2:失败',
  `reason` mediumblob COMMENT 'reason',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `txhash` (`txhash`),
  KEY `_from` (`_from`),
  KEY `_to` (`_to`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_log`
--

DROP TABLE IF EXISTS `t_log`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `t_log` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `type` varchar(255) NOT NULL DEFAULT '' COMMENT '日志类型',
  `subtype` varchar(255) NOT NULL DEFAULT '' COMMENT '日志子类型',
  `param1` mediumblob COMMENT 'param1',
  `param2` mediumblob COMMENT 'param2',
  `param3` mediumblob COMMENT 'param3',
  `param4` mediumblob COMMENT 'param4',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

-- Dump completed on 2015-08-19 18:51:22
