DROP TABLE IF EXISTS `ied_dl_record`;

CREATE TABLE `ied_dl_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `config_id` int(11) DEFAULT NULL,
  `remote_path` varchar(200) DEFAULT NULL COMMENT '源路径',
  `filename` varchar(200) DEFAULT NULL COMMENT '文件名',
  `path` varchar(200) DEFAULT NULL COMMENT '本地路径',
  `create_time` datetime DEFAULT NULL,
  `d_time` datetime DEFAULT NULL,
  `dev_id` int(11) DEFAULT NULL COMMENT '装置ID',
  `type_id` int(11) DEFAULT NULL COMMENT '类型id',
  `data` mediumtext,
  PRIMARY KEY (`id`),
  KEY `idxDev` (`dev_id`,`d_time`),
  KEY `idxConfig` (`config_id`,`d_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `n_sensor`
ADD COLUMN `order_num` INT NULL AFTER `icd_id`,
ADD INDEX `idxOrd` (`order_num` ASC),
ADD INDEX `idxZsb` (`zsb_id` ASC, `order_num` ASC);