ALTER TABLE  `sensors-state` ADD  `sensor_event` VARCHAR( 16 ) NOT NULL AFTER  `sensor_value`;
ALTER TABLE  `sensors-state` ADD  `sensor_status` VARCHAR( 64 ) NOT NULL AFTER  `sensor_event`;
CREATE TABLE IF NOT EXISTS `status-state` (  `status_id` int(11) NOT NULL,  `status_value` varchar(32) DEFAULT NULL,  `status_polled` int(11) NOT NULL,  `status_event` varchar(16) NOT NULL,  `status_name` varchar(64) NOT NULL,  PRIMARY KEY (`status_id`)) ENGINE=MEMORY DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `status` (  `status_id` int(11) NOT NULL AUTO_INCREMENT,  `status_deleted` tinyint(1) NOT NULL DEFAULT '0',  `device_id` int(11) NOT NULL DEFAULT '0',  `poller_type` enum('snmp','agent','ipmi') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp',  `status_oid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,  `status_index` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,  `status_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,  `status_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,  `entPhysicalIndex` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,  `entPhysicalClass` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,  `entPhysicalIndex_measured` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,  `measured_class` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,  `measured_entity` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,  `status_ignore` tinyint(1) NOT NULL DEFAULT '0',  `status_disable` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`status_id`),  KEY `sensor_host` (`device_id`),  KEY `sensor_type` (`status_type`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
