-- 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_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',
  `order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
  `game_id` int(11) NOT NULL DEFAULT '0' COMMENT 'game id',
  `batch_idx` int(11) NOT NULL DEFAULT '0' COMMENT '批次号idx',
  `type` varchar(60) NOT NULL DEFAULT '' COMMENT 'type',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `state` int(11) NOT NULL DEFAULT '0' COMMENT 'state 0:待支付 1：支付成功',
  `bc_synced` int(11) NOT NULL DEFAULT '0' COMMENT '0:未上链 1:已上链',
  `bc_minted` int(11) NOT NULL DEFAULT '0' COMMENT '0:还未生成token 1:已经生成token',
  `bc_sync_count` int(11) NOT NULL DEFAULT '0' COMMENT '本节点同步次数',
  `bc_sync_time` int(11) NOT NULL DEFAULT '0' COMMENT '本节点最后一次同步时间',
  `bc_sync_block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '同步时的块id',
  `bc_mint_count` int(11) NOT NULL DEFAULT '0' COMMENT '尝试生成token次数',
  `bc_mint_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次生成token时间',
  `bc_result` int(11) NOT NULL DEFAULT '0' COMMENT '区块链执行结果 0:失败 1:成功',
  `bc_block_number` varchar(60) NOT NULL DEFAULT '' COMMENT '块id',
  `bc_fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '原因',
  `suspend` int(11) NOT NULL DEFAULT '0' COMMENT '挂起',
  `suspend_reason` mediumblob COMMENT '挂起原因',
  `buyer_address` varchar(60) NOT NULL DEFAULT '' COMMENT '购买者',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `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 '签名',
  `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 `state` (`state`),
  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',
  `game_id` int(11) NOT NULL DEFAULT '0' COMMENT 'game id',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `owner_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'owner_id',
  `owner_address` varchar(255) NOT NULL DEFAULT '' COMMENT 'owner_address',
  `owner_name` varchar(255) NOT NULL DEFAULT '' COMMENT 'owner_name',
  `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` (`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',
  `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_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',
  `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
