CREATETABLE`component_statuslog`(`id`int(11)unsignedNOTNULLAUTO_INCREMENTCOMMENT'ID for each log entry, unique index',`component_id`int(11)unsignedNOTNULLCOMMENT'id from the component table',`status`tinyint(1)NOTNULLDEFAULT'0'COMMENT'The status that the component was changed TO',`timestamp`TIMESTAMPNOTNULLDEFAULTCURRENT_TIMESTAMPCOMMENT'When the status of the component was changed',PRIMARYKEY(`id`),KEY`device`(`component_id`),CONSTRAINT`component_statuslog_ibfk_1`FOREIGNKEY(`component_id`)REFERENCES`component`(`id`)ONDELETECASCADEONUPDATECASCADE)ENGINE=InnoDBAUTO_INCREMENT=0DEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciCOMMENT='log of status changes to a component.';
ALTERTABLE`component`CHANGE`status``status`TINYINT(1)NOTNULLDEFAULT'0'COMMENT'The status of the component, retreived from the device';
UPDATE`config`SET`config_name`='alert.macros.rule.component_warning',`config_descr`='Component status Warning'WHERE`config_name`='alert.macros.rule.component_normal';
UPDATE`config`SET`config_name`='alert.macros.rule.component_normal',`config_descr`='Component status Normal'WHERE`config_name`='alert.macros.rule.component_alert';