DROP TABLE IF EXISTS stsmq;
CREATE TABLE `stsmq` (
  `uniq` int(10) NOT NULL AUTO_INCREMENT,
  `portal` varchar(10) NOT NULL DEFAULT 'invalid',
  `status` varchar(10) NOT NULL DEFAULT 'invalid',
  `command` varchar(12) DEFAULT 'invalid',
  `sgc` varchar(10) DEFAULT '0000',
  `edsn` varchar(20) DEFAULT '00000000000',
  `kwh` double(16,2) DEFAULT '0.00',
  `timeoffset` int(8) DEFAULT '0',
  `token1` varchar(20) DEFAULT '',
  `token2` varchar(20) DEFAULT '',
  `requestdatetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `completedatetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `resultdatetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastmod` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `newsgc` varchar(10) DEFAULT NULL,
  `ti` varchar(10) DEFAULT '01',
  `tid` varchar(10) DEFAULT '',
  PRIMARY KEY (`uniq`),
  UNIQUE KEY `id` (`uniq`),
  KEY `portal` (`portal`) USING BTREE,
  KEY `requestdatetime` (`requestdatetime`) USING BTREE,
  KEY `edsn` (`edsn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
