ALTER TABLE  `alert_contacts_assoc` ADD  `aca_type` ENUM(  'alert',  'syslog' ) NOT NULL DEFAULT  'alert' AFTER  `aca_id` ;
CREATE TABLE IF NOT EXISTS `logalert_tests` (  `la_id` int(11) NOT NULL AUTO_INCREMENT,  `la_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,  `la_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,  `la_rule` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,  `la_severity` int(11) NOT NULL DEFAULT '8',  `la_disable` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`la_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `logalert_logs` (  `lal_id` int(11) NOT NULL AUTO_INCREMENT,  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,  `device_id` int(11) NOT NULL,  `la_id` int(11) NOT NULL,  `syslog_id` int(11) NOT NULL,  `message` varchar(255) COLLATE utf8_unicode_ci NOT NULL,  `program` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,  `sev` tinyint(4) NOT NULL DEFAULT '1',  `ack` tinyint(1) NOT NULL DEFAULT '0',  `notified` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`lal_id`),  KEY `device_id` (`device_id`),  KEY `la_id` (`la_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `logalert_assoc` (  `laa_id` int(11) NOT NULL AUTO_INCREMENT,  `la_id` int(11) NOT NULL,  `entity_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL,  `entity_id` int(11) NOT NULL,  PRIMARY KEY (`laa_id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
