DB: Add new view vw_log_history to show database logs in a better way

This commit is contained in:
jackpoz
2019-06-06 18:13:17 +02:00
parent a45f26ef2d
commit 9fc4ff9dd2
2 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
DROP VIEW IF EXISTS `vw_log_history`;
CREATE VIEW `vw_log_history` AS (SELECT FROM_UNIXTIME(MIN(`logs`.`time`)) AS `First Logged` ,FROM_UNIXTIME(MAX(`logs`.`time`)) AS `Last Logged` ,COUNT(*) AS `Occurrences` ,`realmlist`.`name` AS `Realm` ,`logs`.`type` ,`logs`.`level` ,`logs`.`string` FROM `logs` LEFT JOIN realmlist ON `logs`.`realm` = `realmlist`.`id` GROUP BY `logs`.`string`, `logs`.`type`, `logs`.`realm`);