 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
 ) ENGINE=MyISAM;
 
--- Exportiere Struktur von View lggrdev.lasthour
+-- Exportiere Struktur von View lggr.lasthour
 -- Erstelle temporre Tabelle um View Abhngigkeiten zuvorzukommen
 CREATE TABLE `lasthour` (
 	`id` BIGINT(20) NOT NULL,

	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
) ENGINE=MyISAM;

-- Exportiere Struktur von View lggrdev.year
-- Erstelle temporre Tabelle um View Abhngigkeiten zuvorzukommen
CREATE TABLE `year` (
	`id` BIGINT(20) NOT NULL,

	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
) ENGINE=MyISAM;

-- Exportiere Struktur von View lggr.archived
-- Entferne temporre Tabelle und erstelle die eigentliche View
DROP TABLE IF EXISTS `archived`;
CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` VIEW `archived` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`pid` AS `pid`,`newlogs`.`archived` AS `archived`,`newlogs`.`message` AS `message` from `newlogs` where (`newlogs`.`archived` = 'Y') ;

-- Exportiere Struktur von View lggr.lasthour
-- Entferne temporre Tabelle und erstelle die eigentliche View
DROP TABLE IF EXISTS `lasthour`;
CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` VIEW `lasthour` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`archived` AS `archived`,`newlogs`.`message` AS `message` from `newlogs` where (`newlogs`.`date` >= (now() - interval 1 hour)) ;

-- Exportiere Struktur von View lggr.today
-- Entferne temporre Tabelle und erstelle die eigentliche View
DROP TABLE IF EXISTS `today`;
CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` VIEW `today` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`archived` AS `archived`,`newlogs`.`message` AS `message` from `newlogs` where (cast(now() as date) = cast(`newlogs`.`date` as date)) ;

-- Exportiere Struktur von View lggr.week
-- Entferne temporre Tabelle und erstelle die eigentliche View
DROP TABLE IF EXISTS `week`;
CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` VIEW `week` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`archived` AS `archived`,`newlogs`.`message` AS `message` from `newlogs` where (`newlogs`.`date` >= (now() - interval 168 hour)) ;

-- Exportiere Struktur von View lggr.year
-- Entferne temporre Tabelle und erstelle die eigentliche View
DROP TABLE IF EXISTS `year`;
CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` VIEW `year` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`archived` AS `archived`,`newlogs`.`message` AS `message` from `newlogs` where (`newlogs`.`date` >= (now() - interval 1 year)) ;
