CREATE TABLE IF NOT EXISTS `alert_assoc` (  `alert_assoc_id` int(11) NOT NULL AUTO_INCREMENT,  `alert_test_id` int(11) NOT NULL,  `entity_type` varchar(64) CHARACTER SET utf8 NOT NULL,  `device_attributes` text COLLATE utf8_unicode_ci,  `attributes` text CHARACTER SET utf8,  `enable` tinyint(1) NOT NULL DEFAULT '1',  `alerter` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,  `severity` int(11) DEFAULT NULL,  `count` int(11) DEFAULT NULL,  PRIMARY KEY (`alert_assoc_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `alert_table` (  `alert_table_id` int(11) NOT NULL AUTO_INCREMENT,  `alert_test_id` int(11) NOT NULL,  `device_id` int(11) NOT NULL,  `entity_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL,  `entity_id` int(11) NOT NULL,  `alert_assocs` varchar(64) COLLATE utf8_unicode_ci NOT NULL,  `delay` int(11) NOT NULL,  PRIMARY KEY (`alert_table_id`),  UNIQUE KEY `alert_id_2` (`alert_test_id`,`entity_type`,`entity_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `alert_table-state` (  `alert_table_id` int(11) NOT NULL,  `last_checked` int(11) NOT NULL,  `last_changed` int(11) NOT NULL,  `last_message` varchar(128) COLLATE utf8_unicode_ci NOT NULL,  `alert_status` tinyint(4) NOT NULL DEFAULT '-1',  `last_alerted` int(11) NOT NULL,  `state` varchar(512) COLLATE utf8_unicode_ci NOT NULL,  `count` int(11) NOT NULL,  `state_entry` tinyint(1) NOT NULL DEFAULT '1',  PRIMARY KEY (`alert_table_id`)) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `alert_tests` (  `alert_test_id` int(11) NOT NULL AUTO_INCREMENT,  `entity_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL,  `alert_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,  `alert_message` varchar(128) COLLATE utf8_unicode_ci NOT NULL,  `conditions` text CHARACTER SET utf8,  `and` tinyint(1) NOT NULL DEFAULT '1',  `severity` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,  `delay` int(11) DEFAULT '0',  `alerter` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,  `enable` tinyint(1) NOT NULL DEFAULT '1',  PRIMARY KEY (`alert_test_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
