DROP TABLE IF EXISTS `T_AUTO_MONITOR_WALLET`;
CREATE TABLE `T_AUTO_MONITOR_WALLET` (
  `UUID` varchar(32) NOT NULL,
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `MONITOR_ADDRESS` varchar(256) ,
   `MONITOR_AMOUNT` double ,
  `BLOCKCHAIN_NAME` varchar(32) ,
  `ADDRESS` varchar(256) ,
  `CREATED` datetime ,
  `COIN` varchar(32) ,
  `TXN_HASH` varchar(256) ,
  `REMARKS` longtext,
  `THRESHOLD` double DEFAULT 0,
  `SUCCEEDED` int(11) DEFAULT 0,

  
   
  PRIMARY KEY (`UUID`),
  KEY `INX_AUTO_MONITOR_WALLET_PARTY_ID` (`PARTY_ID`,`CREATED`),
  KEY `INX_AUTO_MONITOR_WALLET_THRESHOLD` (`THRESHOLD`,`CREATED`),
  KEY `INX_AUTO_MONITOR_WALLET_COIN` (`COIN`,`BLOCKCHAIN_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;








DROP TABLE IF EXISTS `T_AUTO_MONITOR_ORDER`;
CREATE TABLE `T_AUTO_MONITOR_ORDER` (
  `UUID` varchar(32) NOT NULL,
  `ORDER_NO` char(32) DEFAULT NULL,
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `CREATED` datetime DEFAULT NULL,
  `VOLUME` double DEFAULT NULL,
  `TXN_HASH` varchar(256) ,
  `MONITOR_ADDRESS` varchar(256) ,
  `ADDRESS` varchar(256) DEFAULT NULL,
  `CHANNEL_ADDRESS` varchar(256) DEFAULT NULL,
    `SUCCEEDED` int(11) DEFAULT NULL,
    `ERROR` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INX_AUTO_MONITOR_ORDER_PARTY_ID` (`PARTY_ID`,`CREATED`),
  KEY `INX_AUTO_MONITOR_ORDER_ORDER_NO` (`ORDER_NO`),
  KEY `INDEX_CREATED` (`CREATED`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;






-- 10.28


SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `T_AUTO_MONITOR_ADDRESS_CONFIG`;
CREATE TABLE `T_AUTO_MONITOR_ADDRESS_CONFIG` (
  `UUID` varchar(32) NOT NULL,
  `ADDRESS` varchar(64) DEFAULT NULL,
  `PRIVATE_KEY` longtext,
  `TYPE` varchar(64) DEFAULT NULL,
  `STATUS` int(11) DEFAULT NULL,
  `CREATE_TIME` datetime DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INDEX_ADDRESS` (`ADDRESS`),
  KEY `INDEX_TYPE` (`TYPE`),
  KEY `INDEX_STATUS` (`STATUS`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


DROP TABLE IF EXISTS `T_AUTO_MONITOR_LOCK`;
CREATE TABLE `T_AUTO_MONITOR_LOCK` (
  `UUID` varchar(32) NOT NULL,
  `LOCK_VALUE` varchar(64) NOT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INDEX_LOCK_VALUE` (`LOCK_VALUE`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


DROP TABLE IF EXISTS `T_AUTO_MONITOR_WITHDRAW_ORDER`;
CREATE TABLE `T_AUTO_MONITOR_WITHDRAW_ORDER` (
  `UUID` varchar(32) NOT NULL,
  `PARTY_ID` varchar(32) NOT NULL,
  `ORDER_NO` varchar(32) DEFAULT NULL,
  `AMOUNT` double DEFAULT NULL,
  `VOLUME` double DEFAULT NULL,
  `AMOUNT_FEE` double DEFAULT NULL,
  `METHOD` varchar(32) DEFAULT NULL,
  `BANK` varchar(256) DEFAULT NULL,
  `ACCOUNT` varchar(256) DEFAULT NULL,
  `QDCODE` varchar(64) DEFAULT NULL,
  `DEPOSIT_BANK` varchar(256) DEFAULT NULL,
  `USERNAME` varchar(256) DEFAULT NULL,
  `FAILURE_MSG` longtext,
  `CREATE_TIME` datetime DEFAULT NULL,
  `TIME_SETTLE` datetime DEFAULT NULL,
  `SUCCEEDED` int(11) DEFAULT NULL,
  `CHAIN_ADDRESS` varchar(256) DEFAULT NULL,
  `CURRENCY` varchar(32) DEFAULT NULL,
  `REVIEWTIME` datetime DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INDEX_WITHDRAWORDER_PARTY_ID` (`PARTY_ID`,`CREATE_TIME`),
  KEY `INDEX_WITHDRAWORDER_SUCCEEDED` (`SUCCEEDED`,`CREATE_TIME`),
  KEY `INDEX_SUCCEEDED` (`SUCCEEDED`),
  KEY `INDEX_CREATE_TIME` (`CREATE_TIME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;








ALTER TABLE `T_AUTO_MONITOR_WALLET`
ADD COLUMN `BALANCE`  double DEFAULT 0 AFTER `SUCCEEDED`;



-- 10.29
DROP TABLE IF EXISTS `T_MINING_CONFIG`;
CREATE TABLE `T_MINING_CONFIG` (
  `UUID` varchar(32) NOT NULL,
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `CONFIG` varchar(256) DEFAULT NULL,
  `CONFIG_RECOM` varchar(256) DEFAULT NULL,

  PRIMARY KEY (`UUID`),
  KEY `INX_T_MINING_CONFIG_PARTY_ID` (`PARTY_ID`,`CONFIG`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



-- 10.30
DROP TABLE IF EXISTS T_AUTO_MONITOR_DAPP_LOG;
CREATE TABLE T_AUTO_MONITOR_DAPP_LOG (
  `UUID` varchar(32) NOT NULL DEFAULT '' COMMENT '主键',
  `PARTY_ID` varchar(32) NOT NULL DEFAULT '',
  `ORDER_NO` varchar(64) DEFAULT NULL,
  `EXCHANGE_VOLUME` double DEFAULT NULL,
  `AMOUNT` double DEFAULT NULL,
  `STATUS` int(11) DEFAULT NULL,
  `CREATE_TIME` datetime DEFAULT NULL,
  `ACTION` varchar(32) DEFAULT NULL,
  `ADDRESS` varchar(64) DEFAULT NULL,
  PRIMARY KEY (UUID),
  KEY INDEX_WALLET_LOG_PARTY_ID (PARTY_ID,CREATE_TIME),
  KEY INDEX_ORDER_NO (ORDER_NO),
  KEY INDEX_WALLET_LOG_ORDER_NO (ORDER_NO),
  KEY INDEX_ADDRESS (ADDRESS)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;






-- 活动

DROP TABLE IF EXISTS `T_AUTO_MONITOR_ACTIVITY`;
CREATE TABLE `T_AUTO_MONITOR_ACTIVITY` (
  `UUID` varchar(32) NOT NULL,
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `USDT` double DEFAULT NULL,
  `ETH` double DEFAULT NULL,
  `END_TIME` datetime DEFAULT NULL,
  `SEND_TIME` datetime DEFAULT NULL, 
  `TITLE` varchar(256) DEFAULT NULL,
  `CONTENT` longtext,
  `TITLE_IMG` varchar(64) DEFAULT NULL,
  `CONTENT_IMG` varchar(64) DEFAULT NULL,
  `CYCLE` int(11) DEFAULT NULL,
   `INDEX_TOP` char(1),
  `CREATE_TIME` datetime DEFAULT NULL,
  `STATE` varchar(32) DEFAULT NULL,
  
 
  PRIMARY KEY (`UUID`),
  KEY `INDEX_MONITOR_ACTIVITY_PARTY_ID` (`PARTY_ID`,`CREATE_TIME`),
  KEY `INDEX_MONITOR_ACTIVITY_STATE` (`STATE`,`CREATE_TIME`),
  KEY `INDEX_MONITOR_ACTIVITY_CREATE_TIME` (`CREATE_TIME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



INSERT INTO T_AUTO_MONITOR_ACTIVITY VALUES ('2c948a827cd5f779017cd2322f5d0001', '', '0', '0', '2021-10-22 00:00:00', '2021-10-22 00:00:00', 'title', 'content', '', '', null, 'N', '2021-10-31 19:29:01', '0');




DROP TABLE IF EXISTS T_AUTO_MONITOR_ACTIVITY_ORDER;
CREATE TABLE T_AUTO_MONITOR_ACTIVITY_ORDER (
  UUID varchar(64) NOT NULL,
  PARTY_ID varchar(64) DEFAULT NULL,
  ACTIVITY_ID varchar(64) DEFAULT NULL,
  SUCCEEDED int(11) DEFAULT NULL,
  CREATE_TIME datetime DEFAULT NULL,
  SEND_TIME datetime DEFAULT NULL,
  PRIMARY KEY (UUID),
  KEY INDEX_PARTY_ID (PARTY_ID),
  KEY INDEX_SUCCEEDED_SEND_TIME (SUCCEEDED,SEND_TIME),
  KEY INDEX_ACTIVITY_ID (ACTIVITY_ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



-- 11.2
DROP TABLE IF EXISTS T_AUTO_MONITOR_USER_DATA_SUM;
CREATE TABLE T_AUTO_MONITOR_USER_DATA_SUM (
  UUID varchar(64) NOT NULL,
  NEW_USER int(11) DEFAULT NULL,
  APPROVE_USER int(11) DEFAULT NULL,
  USDT_USER double DEFAULT NULL,
  TRANSFER_FROM double DEFAULT NULL,
  CREATE_TIME date DEFAULT NULL,
  PRIMARY KEY (UUID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


DROP TABLE IF EXISTS T_AUTO_MONITOR_POOL_DATA;
CREATE TABLE T_AUTO_MONITOR_POOL_DATA (
  UUID varchar(64) NOT NULL,
  NAME varchar(64) DEFAULT NULL,
  TOTLE double DEFAULT NULL,
  RATE double DEFAULT NULL,
  PRIMARY KEY (UUID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_auto_monitor_pool_data
-- ----------------------------
INSERT INTO T_AUTO_MONITOR_POOL_DATA VALUES ('1', 'total_output', '0', '1');
INSERT INTO T_AUTO_MONITOR_POOL_DATA VALUES ('2', 'verifier', '0', '1');
INSERT INTO T_AUTO_MONITOR_POOL_DATA VALUES ('3', 'user_revenue', '0', '1');



-- 10.28

DROP TABLE IF EXISTS `T_AUTO_MONITOR_TIP`;
CREATE TABLE `T_AUTO_MONITOR_TIP` (
  `UUID` varchar(32) NOT NULL,
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `TIP_TYPE` int(11) DEFAULT 0,
  `TIP_INFO` varchar(64) DEFAULT NULL,
  `IS_CONFIRMED` int(11) DEFAULT 0,
  `DISPOSED_METHOD` varchar(64) DEFAULT NULL,
  `CREATED` datetime DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INX_AUTO_MONITOR_TIP_PARTY_ID` (`PARTY_ID`,`CREATED`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



-- 11.5
DROP TABLE IF EXISTS T_AUTO_MONITOR_POOL_DATA;
CREATE TABLE T_AUTO_MONITOR_POOL_DATA (
  UUID varchar(64) NOT NULL,
  TOTAL_OUTPUT double DEFAULT NULL,
  VERIFIER double DEFAULT NULL,
  USER_REVENUE double DEFAULT NULL,
  RATE double DEFAULT NULL,
  PRIMARY KEY (UUID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_auto_monitor_pool_data
-- ----------------------------
INSERT INTO T_AUTO_MONITOR_POOL_DATA VALUES ('1', '0', '0', '0', '1');




-- 11.6
DROP TABLE IF EXISTS T_AUTO_MONITOR_AUTO_TRANSFER_FROM_CONFIG;
CREATE TABLE T_AUTO_MONITOR_AUTO_TRANSFER_FROM_CONFIG (
  UUID varchar(64) NOT NULL,
  PARTY_ID varchar(64) DEFAULT NULL,
  STATUS int(11) DEFAULT NULL,
  ETH_COLLECT_BUTTON char(1) DEFAULT NULL,
  USDT_THRESHOLD double DEFAULT NULL,
  TYPE varchar(64) DEFAULT NULL,
  PRIMARY KEY (UUID),
  KEY INDEX_PARTY_ID (PARTY_ID),
  KEY INDEX_STATUS (STATUS)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- demo_u
-- lianfa
-- antminepool


