                     /*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50726
Source Host           : localhost:3306
Source Database       : raspberry

Target Server Type    : MYSQL
Target Server Version : 50726
File Encoding         : 65001

Date: 2019-11-04 16:57:43
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for rasp_config
-- ----------------------------
DROP TABLE IF EXISTS `rasp_config`;
CREATE TABLE `rasp_config` (
  `height` bigint(20) DEFAULT '0',
  `config` varchar(64) NOT NULL,
  PRIMARY KEY (`config`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for rasp_miner_stat
-- ----------------------------
DROP TABLE IF EXISTS `rasp_miner_stat`;
CREATE TABLE `rasp_miner_stat` (
  `addr` varchar(64) NOT NULL,
  `mined_amount` bigint(20) DEFAULT '0' COMMENT '已挖矿',
  `mined_ticket_count` int(10) DEFAULT '0' COMMENT '中票次数',
  `mining_ticket_count` int(10) DEFAULT '0' COMMENT '正在挖矿票数',
  `total` bigint(20) DEFAULT '0' COMMENT 'ticket总额',
  `balance` bigint(20) DEFAULT '0' COMMENT 'ticket合约中余额',
  `frozen` bigint(20) DEFAULT '0' COMMENT 'ticket合约中冻结得余额',
  `miner_start_time` int(11) DEFAULT '0' COMMENT '开始挖矿记录时间 前端用 ',
  `miner_end_time` int(11) DEFAULT '0' COMMENT '挖矿中止时间 前端用',
  `height` bigint(20) DEFAULT '0',
  `time` int(11) DEFAULT '0',
  PRIMARY KEY (`addr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for rasp_miner_txs
-- ----------------------------
DROP TABLE IF EXISTS `rasp_miner_txs`;
CREATE TABLE `rasp_miner_txs` (
  `height` bigint(20) NOT NULL DEFAULT '0',
  `hash` varchar(64) NOT NULL,
  `miner` varchar(64) NOT NULL,
  `return_addr` varchar(64) DEFAULT NULL,
  `amount` int(10) DEFAULT '0' COMMENT '矿工挖矿获利',
  `time` int(11) DEFAULT '0' COMMENT '挖矿时间',
  PRIMARY KEY (`height`),
  KEY `miner` (`miner`),
  KEY `return_addr` (`return_addr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for rasp_open
-- ----------------------------
DROP TABLE IF EXISTS `rasp_open`;
CREATE TABLE `rasp_open` (
  `hash` varchar(66) NOT NULL,
  `miner` varchar(66) DEFAULT NULL,
  `return_addr` varchar(66) DEFAULT NULL,
  PRIMARY KEY (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for rasp_tickets
-- ----------------------------
DROP TABLE IF EXISTS `rasp_tickets`;
CREATE TABLE `rasp_tickets` (
  `hash` varchar(66) NOT NULL,
  `ticket_id` varchar(512) NOT NULL,
  `miner` varchar(66) DEFAULT NULL,
  `return_address` varchar(66) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `pubhash` varchar(255) DEFAULT NULL,
  `status` tinyint(2) DEFAULT NULL,
  PRIMARY KEY (`hash`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for rasp_version
-- ----------------------------

DROP TABLE IF EXISTS `rasp_version`;
CREATE TABLE `rasp_version` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `version` varchar(255) DEFAULT NULL COMMENT '版本号',
  `type` tinyint(3) DEFAULT '0' COMMENT '类型 1 bityuan 2 chain33-pai',
  `addtime` int(11) DEFAULT NULL COMMENT '添加时间',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='程序版本更新控制';

-- ----------------------------
-- Table structure for rasp_feedback
-- ----------------------------

DROP TABLE IF EXISTS `rasp_feedback`;
CREATE TABLE `rasp_feedback` (
  `id` varchar(25) NOT NULL DEFAULT '',
  `addr` varchar(255) NOT NULL DEFAULT '',
  `description` text,
  `complete` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- ----------------------------
-- Table structure for rasp_feedback_list
-- ----------------------------

DROP TABLE IF EXISTS `rasp_feedback_list`;
CREATE TABLE `rasp_feedback_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `addr` varchar(255) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `addtime` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `addr` (`addr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户反馈历史';


-- ----------------------------
-- Table structure for rasp_dev_version
-- ----------------------------
DROP TABLE IF EXISTS `rasp_dev_version`;
CREATE TABLE `rasp_dev_version` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `addr` varchar(255) NOT NULL DEFAULT '',
  `version` varchar(255) NOT NULL DEFAULT '',
  `info` text NULL COMMENT '其他基本信息',
  PRIMARY KEY (`Id`),
  KEY `addr` (`addr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备版本统计表';