SET NAMES 'GBK';
DELIMITER ;//


/* ÍøÅÌÉó¼Æ±í */
DROP TABLE IF EXISTS SM_RC_SESSION_BRIEF;
CREATE TABLE SM_RC_SESSION_BRIEF(
  `SU_SEQ` bigint(20) NOT NULL,
  `PART_FD` int(11) NOT NULL,
  `TIME_BEGIN` datetime DEFAULT NULL,
  `TIME_END` datetime DEFAULT NULL,
  `CLI_DID` bigint(20) NOT NULL DEFAULT '0',
  `CLI_IP` bigint(20) DEFAULT '0',
  `CLI_PORT` int(11) DEFAULT '-1',
  `CLI_MAC` varchar(17) DEFAULT NULL,
  `CLI_AREA_ID` bigint(20) unsigned DEFAULT '0',
  `CLI_DETAIL` varchar(256) DEFAULT NULL,
  `SRV_IP` bigint(20) DEFAULT '0',
  `SRV_PORT` int(11) DEFAULT '-1',
  `SRV_MAC` varchar(17) DEFAULT NULL,
  `SRV_AREA_ID` bigint(20) unsigned DEFAULT '0',
  `SRV_DETAIL` varchar(256) DEFAULT NULL,
  `SRV_DOMAIN` varchar(256) DEFAULT NULL,
  `SUBAPP_TYPE` int(11) DEFAULT '-1',
  `ACCOUNT` varchar(128) DEFAULT NULL,
  `PASSWD` varchar(128) DEFAULT NULL,
  `TOTAL_RECV_BYTES` bigint(20) unsigned DEFAULT '0',
  `TOTAL_RECV_PKTS` bigint(20) unsigned DEFAULT '0',
  `TOTAL_SEND_BYTES` bigint(20) unsigned DEFAULT '0',
  `TOTAL_SEND_PKTS` bigint(20) unsigned DEFAULT '0',
  `REQ_NUMS` bigint(20) unsigned DEFAULT '0',
  `RSP_NUMS` bigint(20) unsigned DEFAULT '0',
  `LOGON_STATUS` int(11) DEFAULT '0',
  KEY `SU_SEQ` (`SU_SEQ`),
  KEY `IDX_SM_QQ_FILE_CLI_IP` (`CLI_IP`),
  KEY `IDX_SM_QQ_FILE_SRV_IP` (`SRV_IP`),
  KEY `IDX_SM_WEB_CLI_DID` (`CLI_DID`),
  KEY `IDX_SM_WEB_CLI_MAC` (`CLI_MAC`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk PARTITION BY HASH (PART_FD) PARTITIONS 100 ;


/* FTPÃüÁî±í */

TRUNCATE TABLE SM_RC_FTP;
FLUSH TABLES;

ALTER TABLE SM_RC_FTP ADD COLUMN SESSION_BRIEF bigint(20) unsigned DEFAULT '0' AFTER PART_FD;

ALTER TABLE SM_RC_FTP ADD INDEX  IDX_SM_RC_FTP_SESSION_BRIEF (SESSION_BRIEF);

/* telnet ÃüÁî±í */
TRUNCATE TABLE SM_RC_TELNET;
FLUSH TABLES;

ALTER TABLE SM_RC_TELNET ADD COLUMN SESSION_BRIEF bigint(20) unsigned DEFAULT '0' AFTER PART_FD;

ALTER TABLE SM_RC_TELNET ADD INDEX  IDX_SM_RC_TELNET_SESSION_BRIEF (SESSION_BRIEF);

UPDATE CFG_PRODUCT_VARIABLES SET VALUE='1.1.3.6' WHERE VARIABLE_NAME='DB_VERSION';
