/*
Navicat MySQL Data Transfer

Source Server         : 166
Source Server Version : 50636
Source Host           : 192.168.5.166:3306
Source Database       : monk_live

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

Date: 2019-04-11 18:23:10
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `username` varchar(255) DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) DEFAULT NULL COMMENT '用户密码',
  `addtime` varchar(30) DEFAULT NULL COMMENT '添加时间',
  `email` varchar(50) DEFAULT NULL COMMENT '邮箱地址',
  `nickname` varchar(50) DEFAULT NULL COMMENT '昵称',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for mt4_config
-- ----------------------------
DROP TABLE IF EXISTS `mt4_config`;
CREATE TABLE `mt4_config` (
  `CONFIG` int(11) NOT NULL,
  `VALUE_INT` int(11) DEFAULT NULL,
  `VALUE_STR` char(255) DEFAULT NULL,
  PRIMARY KEY (`CONFIG`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for mt4_prices
-- ----------------------------
DROP TABLE IF EXISTS `mt4_prices`;
CREATE TABLE `mt4_prices` (
  `SYMBOL` char(16) NOT NULL,
  `TIME` datetime NOT NULL,
  `BID` double NOT NULL,
  `ASK` double NOT NULL,
  `LOW` double NOT NULL,
  `HIGH` double NOT NULL,
  `DIRECTION` int(11) NOT NULL,
  `DIGITS` int(11) NOT NULL,
  `SPREAD` int(11) NOT NULL,
  `MODIFY_TIME` datetime NOT NULL,
  PRIMARY KEY (`SYMBOL`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for mt4_trades
-- ----------------------------
DROP TABLE IF EXISTS `mt4_trades`;
CREATE TABLE `mt4_trades` (
  `TICKET` int(11) NOT NULL,
  `LOGIN` int(11) NOT NULL,
  `SYMBOL` char(16) NOT NULL,
  `DIGITS` int(11) NOT NULL,
  `CMD` int(11) NOT NULL,
  `VOLUME` int(11) NOT NULL,
  `OPEN_TIME` datetime NOT NULL,
  `OPEN_PRICE` double NOT NULL,
  `SL` double NOT NULL,
  `TP` double NOT NULL,
  `CLOSE_TIME` datetime NOT NULL,
  `EXPIRATION` datetime NOT NULL,
  `REASON` int(11) NOT NULL DEFAULT '0',
  `CONV_RATE1` double NOT NULL,
  `CONV_RATE2` double NOT NULL,
  `COMMISSION` double NOT NULL,
  `COMMISSION_AGENT` double NOT NULL,
  `SWAPS` double NOT NULL,
  `CLOSE_PRICE` double NOT NULL,
  `PROFIT` double NOT NULL,
  `TAXES` double NOT NULL,
  `COMMENT` char(32) NOT NULL,
  `INTERNAL_ID` int(11) NOT NULL,
  `MARGIN_RATE` double NOT NULL,
  `TIMESTAMP` int(11) NOT NULL,
  `MAGIC` int(11) NOT NULL DEFAULT '0',
  `GW_VOLUME` int(11) NOT NULL DEFAULT '0',
  `GW_OPEN_PRICE` int(11) NOT NULL DEFAULT '0',
  `GW_CLOSE_PRICE` int(11) NOT NULL DEFAULT '0',
  `MODIFY_TIME` datetime NOT NULL,
  PRIMARY KEY (`TICKET`),
  KEY `INDEX_LOGIN` (`LOGIN`),
  KEY `INDEX_CMD` (`CMD`),
  KEY `INDEX_OPENTIME` (`OPEN_TIME`),
  KEY `INDEX_CLOSETIME` (`CLOSE_TIME`),
  KEY `INDEX_STAMP` (`TIMESTAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for mt4_users
-- ----------------------------
DROP TABLE IF EXISTS `mt4_users`;
CREATE TABLE `mt4_users` (
  `LOGIN` int(11) NOT NULL,
  `GROUP` char(16) NOT NULL,
  `ENABLE` int(11) NOT NULL,
  `ENABLE_CHANGE_PASS` int(11) NOT NULL,
  `ENABLE_READONLY` int(11) NOT NULL,
  `ENABLE_OTP` int(11) NOT NULL DEFAULT '0',
  `PASSWORD_PHONE` char(32) NOT NULL,
  `NAME` char(128) NOT NULL,
  `COUNTRY` char(32) NOT NULL,
  `CITY` char(32) NOT NULL,
  `STATE` char(32) NOT NULL,
  `ZIPCODE` char(16) NOT NULL,
  `ADDRESS` char(128) NOT NULL,
  `LEAD_SOURCE` char(32) NOT NULL DEFAULT '',
  `PHONE` char(32) NOT NULL,
  `EMAIL` char(48) NOT NULL,
  `COMMENT` char(64) NOT NULL,
  `ID` char(32) NOT NULL,
  `STATUS` char(16) NOT NULL,
  `REGDATE` datetime NOT NULL,
  `LASTDATE` datetime NOT NULL,
  `LEVERAGE` int(11) NOT NULL,
  `AGENT_ACCOUNT` int(11) NOT NULL,
  `TIMESTAMP` int(11) NOT NULL,
  `BALANCE` double NOT NULL,
  `PREVMONTHBALANCE` double NOT NULL,
  `PREVBALANCE` double NOT NULL,
  `CREDIT` double NOT NULL,
  `INTERESTRATE` double NOT NULL,
  `TAXES` double NOT NULL,
  `SEND_REPORTS` int(11) NOT NULL,
  `MQID` int(10) unsigned NOT NULL DEFAULT '0',
  `USER_COLOR` int(11) NOT NULL,
  `EQUITY` double NOT NULL DEFAULT '0',
  `MARGIN` double NOT NULL DEFAULT '0',
  `MARGIN_LEVEL` double NOT NULL DEFAULT '0',
  `MARGIN_FREE` double NOT NULL DEFAULT '0',
  `CURRENCY` char(16) NOT NULL DEFAULT '',
  `API_DATA` blob,
  `MODIFY_TIME` datetime NOT NULL,
  PRIMARY KEY (`LOGIN`),
  KEY `INDEX_STAMP` (`TIMESTAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for order_progress
-- ----------------------------
DROP TABLE IF EXISTS `order_progress`;
CREATE TABLE `order_progress` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `type` varchar(50) DEFAULT NULL COMMENT '类型',
  `orig_order` varchar(50) DEFAULT NULL,
  `orig_login` varchar(50) DEFAULT NULL,
  `dest_order` varchar(50) DEFAULT NULL,
  `dest_login` varchar(50) DEFAULT NULL,
  `error_code` varchar(10) DEFAULT NULL COMMENT '错误码(0成功)',
  `profit` varchar(20) DEFAULT NULL COMMENT '利润点',
  `percentage` varchar(50) DEFAULT NULL,
  `addtime` varchar(50) DEFAULT NULL COMMENT '添加时间',
  `stasus` varchar(10) DEFAULT NULL COMMENT '状态码(后续使用）',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=60522 DEFAULT CHARSET=utf8;
