-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: bcnft
-- ------------------------------------------------------
-- 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_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',
  `owner_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'owner_address',
  `last_owner_address` varchar(60) COMMENT 'last_owner_address',
  `last_lock_idx` bigint NOT NULL DEFAULT '0' COMMENT 'last_lock_idx',
  `last_lock_address` varchar(60) COMMENT 'last_lock_address',
  `last_lock_sender` varchar(60) COMMENT 'last_lock_sender',
  `last_lock_time` int(11) NOT NULL DEFAULT '0' COMMENT 'last_lock_time',
  `creator_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'creator_address',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `token_type` int(11) NOT NULL DEFAULT '0' COMMENT 'nft类型 1:英雄 2:枪支 3:芯片 6:荣誉 7:徽章',
  `token_state` int(11) NOT NULL DEFAULT '0' COMMENT '0:正常状态 1:出售中 2:出租中',
  `quality` int(11) NOT NULL DEFAULT '0' COMMENT 'quality',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `deleted` int(11) NOT NULL DEFAULT '0' COMMENT 'deleted',
  `confirm_count` int(11) NOT NULL DEFAULT '0' COMMENT 'confirm_count',
  `confirm_block_number` bigint NOT NULL DEFAULT '0' COMMENT 'confirm_block_number',
  `tags` varchar(60) NOT NULL DEFAULT '' COMMENT 'tags',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `last_refresh_meta_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次刷新Meta时间',
  `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `unikey` (`net_id`, `contract_address`, `token_id`),
  KEY `owner_address_token_type` (`owner_address`, `token_type`),
  KEY `owner_address_contract_address` (`owner_address`, `contract_address`),
  KEY `idx_net_id_token_type_owner_address_last_owner_address` (`net_id`, `token_type`, `owner_address`, `last_owner_address`),
  KEY `idx_net_id_token_type_token_id` (`net_id`, `token_type`, `token_id`),
  KEY `idx_last_owner_address` (`last_owner_address`),
  KEY `idx_last_lock_address` (`last_lock_address`),
  KEY `idx_last_lock_sender` (`last_lock_sender`),
  KEY `idx_item_id` (`item_id`),
  KEY `idx_quality` (`quality`),
  KEY `idx_last_refresh_meta_time` (`last_refresh_meta_time`),
  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_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 */;

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

DROP TABLE IF EXISTS `t_nft1155`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_nft1155` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `owner_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'owner_address',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
  `balance` bigint NOT NULL DEFAULT '0' COMMENT '余额',
  `item_uniid` bigint NOT NULL DEFAULT '0' COMMENT 'item_uniid',
  `confirm_count` int(11) NOT NULL DEFAULT '0' COMMENT 'confirm_count',
  `confirm_block_number` bigint NOT NULL DEFAULT '0' COMMENT 'confirm_block_number',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `unikey` (`owner_address`, `contract_address`, `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_callback`
--

DROP TABLE IF EXISTS `t_callback`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `t_callback` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `cb_uuid` varchar(60) COMMENT '年月日时分秒_进程id_自增id',
  `params` mediumblob COMMENT '需要签名的字段(json不含签名)',
  `signature` varchar(60) COMMENT 'signature',
  `secret_key` varchar(60) COMMENT 'secret_key',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `cb_uuid` (`cb_uuid`),
  KEY `signature` (`signature`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_order`
--

DROP TABLE IF EXISTS `t_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
  `chain` varchar(60) NOT NULL DEFAULT '' COMMENT 'chain',
  `status` varchar(60) NOT NULL DEFAULT '' COMMENT 'status',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `seller_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'seller_address',
  `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id',
  `hero_quality` int(11) NOT NULL DEFAULT '0' COMMENT 'hero_quality',
  `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price',
  `price_len` int(11) NOT NULL DEFAULT '0' COMMENT 'price_len',
  `src_price_exchange_rate` bigint(11) NOT NULL DEFAULT '0' COMMENT 'src_price_exchange_rate',
  `src_price_amount` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_amount',
  `src_price_contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_contract_address',
  `src_price_item_type` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_item_type',
  `start_time` int(11) NOT NULL DEFAULT '0' COMMENT 'start_time',
  `end_time` int(11) NOT NULL DEFAULT '0' COMMENT 'end_time',
  `created_at` int(11) NOT NULL DEFAULT '0' COMMENT 'created_at',
  `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT 'updated_at',
  `event_id` varchar(60) NOT NULL DEFAULT '' COMMENT '事件id',
  `event_data` mediumblob COMMENT '事件内容',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `idx_net_id_contract_address_token_id` (`net_id`, `contract_address`, `token_id`),
  KEY `idx_status` (`status`),
  KEY `idx_item_id` (`item_id`),
  KEY `idx_hero_quality` (`hero_quality`),
  KEY `idx_price` (`price`),
  KEY `idx_price_len` (`price_len`),
  KEY `idx_price_price_len` (`price_len`, `price`),
  KEY `idx_event_id` (`event_id`),
  KEY `idx_contract_address` (`contract_address`),
  KEY `idx_token_id` (`token_id`),
  KEY `idx_seller_address` (`seller_address`),
  KEY `idx_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_sale`
--

DROP TABLE IF EXISTS `t_sale`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_sale` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
  `chain` varchar(60) NOT NULL DEFAULT '' COMMENT 'chain',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
  `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
  `buyer` varchar(60) NOT NULL DEFAULT '' COMMENT 'buyer',
  `seller` varchar(60) NOT NULL DEFAULT '' COMMENT 'seller',
  `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id',
  `hero_quality` int(11) NOT NULL DEFAULT '0' COMMENT 'hero_quality',
  `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price',
  `indexed_at` int(11) NOT NULL DEFAULT '0' COMMENT 'indexed_at',
  `event_id` varchar(60) NOT NULL DEFAULT '' COMMENT '事件id',
  `event_data` mediumblob COMMENT '事件内容',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `idx_order_id` (`order_id`),
  KEY `idx_buyer` (`buyer`),
  KEY `idx_item_id` (`item_id`),
  KEY `idx_seller` (`seller`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_shopcart`
--

DROP TABLE IF EXISTS `t_shopcart`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_shopcart` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `open_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'open_id',
  `data` mediumblob COMMENT '购物车数据',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `idx_open_id` (`open_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_used_gold_bullion`
--

DROP TABLE IF EXISTS `t_used_gold_bullion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_used_gold_bullion` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'open_id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `idx_net_id_token_id` (`net_id`, `token_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_staking_daily_settlement`
--

DROP TABLE IF EXISTS `t_staking_daily_settlement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_staking_daily_settlement` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_address` varchar(60) NOT NULL DEFAULT '' COMMENT '钱包地址',
  `settle_date` int(11) NOT NULL DEFAULT '0' COMMENT '结算日期',
  `contribution` double NOT NULL DEFAULT '0' COMMENT '贡献点',
  `nft_data` mediumblob COMMENT 'nft数据',
  `last_contribution` double NOT NULL DEFAULT '0' COMMENT '最后一次计算的贡献点-用于日后分析',
  `last_nft_data` mediumblob COMMENT '最后一次nft数据-用于日后分析',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `idx_account_address_settle_date` (`account_address`, `settle_date`),
  KEY `idx_account_address` (`account_address`),
  KEY `idx_settle_date` (`settle_date`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_contribution`
--

DROP TABLE IF EXISTS `t_contribution`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_contribution` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_address` varchar(60) NOT NULL DEFAULT '' COMMENT '钱包地址',
  `contribution` double 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 `idx_account_address` (`account_address`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_recharge_order`
--

DROP TABLE IF EXISTS `t_recharge_order`;
/*!40101 SET @saved_cs_client      = @@character_set_client */;
/*!40101 SET character_set_client  = utf8 */;
CREATE TABLE `t_recharge_order` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
  `txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash',
  `order_id` varchar(80) COMMENT '订单号',
  `short_order_id` bigint NOT NULL DEFAULT '0' COMMENT '短订单号-客户端显示用',
  `account_address` varchar(60) NOT NULL COMMENT '钱包地址',
  `passport_address` varchar(60) NOT NULL COMMENT 'passport地址',
  `currency_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址',
  `currency_name` varchar(60) NOT NULL DEFAULT '' COMMENT '货币名称',
  `item_id` int(11) NOT NULL COMMENT '道具id',
  `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',
  `price` varchar(80) COLLATE utf8_bin NOT NULL COMMENT '价格',
  `diamond` double NOT NULL DEFAULT '0' COMMENT 'diamond',
  `pay_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:支付中 1:支付成功',
  `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '支付成功时间',
  `delivery_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:未发货 1:发货成功',
  `delivery_time` int(11) NOT NULL DEFAULT '0' COMMENT '发货成功时间',
  `receiver_account_id` varchar(60) COMMENT '收货人account_id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `uk_order_id` (`order_id`),
  UNIQUE KEY `uk_short_order_id` (`short_order_id`),
  KEY `idx_account_address` (`account_address`),
  KEY `idx_passport_address` (`passport_address`),
  KEY `idx_pay_status` (`pay_status`),
  KEY `idx_delivery_status` (`delivery_status`),
  KEY `idx_passport_address_pay_status_delivery_status` (`passport_address`, `pay_status`, `delivery_status`),
  KEY `idx_pay_status_delivery_status` (`pay_status`, `delivery_status`),
  KEY `idx_pay_time` (`pay_time`),
  KEY `idx_createtime` (`createtime`),
  KEY `idx_delivery_time` (`delivery_time`),
  KEY `idx_receiver_account_id` (`receiver_account_id`)
) 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
