Browse Source

fix db.sql script to use live db name

Kai Kretschmann 9 months ago
parent
commit
1b7771ee79
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      doc/db.sql

+ 15
- 2
doc/db.sql View File

@@ -12,11 +12,11 @@
12 12
 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13 13
 
14 14
 
15
-CREATE DATABASE IF NOT EXISTS `lggrdev` /*!40100 DEFAULT CHARACTER SET latin1 */;
16
-USE `lggrdev`;
15
+-- Exportiere Datenbank Struktur für lggr
16
+CREATE DATABASE IF NOT EXISTS `lggr` /*!40100 DEFAULT CHARACTER SET latin1 */;
17
+USE `lggr`;
17 18
 
19
+-- Exportiere Struktur von View lggr.archived
18 20
 -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
19 21
 CREATE TABLE `archived` (
20 22
 	`id` BIGINT(20) NOT NULL,
@@ -30,7 +30,7 @@ CREATE TABLE `archived` (
30 30
 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
31 31
 ) ENGINE=MyISAM;
32 32
 
33
+-- Exportiere Struktur von View lggr.lasthour
33 34
 -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
34 35
 CREATE TABLE `lasthour` (
35 36
 	`id` BIGINT(20) NOT NULL,
@@ -43,7 +43,7 @@ CREATE TABLE `lasthour` (
43 43
 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
44 44
 ) ENGINE=MyISAM;
45 45
 
46
+-- Exportiere Struktur von Tabelle lggr.newlogs
46 47
 CREATE TABLE IF NOT EXISTS `newlogs` (
47 48
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
48 49
   `date` datetime NOT NULL,
@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS `newlogs` (
63 63
 ) ENGINE=Aria AUTO_INCREMENT=112111909 DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='New logging table';
64 64
 
65 65
 -- Daten Export vom Benutzer nicht ausgewählt
66
+-- Exportiere Struktur von Tabelle lggr.servers
66 67
 CREATE TABLE IF NOT EXISTS `servers` (
67 68
   `id` int(11) NOT NULL AUTO_INCREMENT,
68 69
   `name` varchar(50) NOT NULL DEFAULT '0',
@@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS `servers` (
72 72
 ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1 COMMENT='List of all servers we have referenced in newlogs';
73 73
 
74 74
 -- Daten Export vom Benutzer nicht ausgewählt
75
+-- Exportiere Struktur von View lggr.today
75 76
 -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
76 77
 CREATE TABLE `today` (
77 78
 	`id` BIGINT(20) NOT NULL,
@@ -85,7 +85,7 @@ CREATE TABLE `today` (
85 85
 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
86 86
 ) ENGINE=MyISAM;
87 87
 
88
+-- Exportiere Struktur von View lggr.week
88 89
 -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
89 90
 CREATE TABLE `week` (
90 91
 	`id` BIGINT(20) NOT NULL,
@@ -98,7 +98,7 @@ CREATE TABLE `week` (
98 98
 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
99 99
 ) ENGINE=MyISAM;
100 100
 
101
+-- Exportiere Struktur von View lggr.year
101 102
 -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
102 103
 CREATE TABLE `year` (
103 104
 	`id` BIGINT(20) NOT NULL,
@@ -111,27 +111,27 @@ CREATE TABLE `year` (
111 111
 	`message` TEXT NOT NULL COLLATE 'utf8_general_ci'
112 112
 ) ENGINE=MyISAM;
113 113
 
114
+-- Exportiere Struktur von View lggr.archived
114 115
 -- Entferne temporäre Tabelle und erstelle die eigentliche View
115 116
 DROP TABLE IF EXISTS `archived`;
116 117
 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') ;
117 118
 
119
+-- Exportiere Struktur von View lggr.lasthour
118 120
 -- Entferne temporäre Tabelle und erstelle die eigentliche View
119 121
 DROP TABLE IF EXISTS `lasthour`;
120 122
 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)) ;
121 123
 
124
+-- Exportiere Struktur von View lggr.today
122 125
 -- Entferne temporäre Tabelle und erstelle die eigentliche View
123 126
 DROP TABLE IF EXISTS `today`;
124 127
 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)) ;
125 128
 
129
+-- Exportiere Struktur von View lggr.week
126 130
 -- Entferne temporäre Tabelle und erstelle die eigentliche View
127 131
 DROP TABLE IF EXISTS `week`;
128 132
 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)) ;
129 133
 
134
+-- Exportiere Struktur von View lggr.year
130 135
 -- Entferne temporäre Tabelle und erstelle die eigentliche View
131 136
 DROP TABLE IF EXISTS `year`;
132 137
 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)) ;

Loading…
Cancel
Save
Social stuff:
Mastodon