Skip to content

Commit 57ad9ea

Browse files
author
Miha Petkovsek
committed
Added hostname and severity index
1 parent baac47b commit 57ad9ea

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

db/SCHEMA.sql

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,17 @@ CREATE TABLE `traps` (
111111
`hostname` varchar(32) DEFAULT NULL,
112112
`ip` varchar(15) DEFAULT NULL,
113113
`oid` varchar(128) DEFAULT NULL,
114-
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
114+
`date` timestamp NULL DEFAULT current_timestamp(),
115115
`message` varchar(256) DEFAULT NULL,
116116
`severity` varchar(32) DEFAULT 'unknown',
117-
`content` text,
118-
`raw` text,
119-
PRIMARY KEY (`id`)
117+
`content` text DEFAULT NULL,
118+
`raw` text DEFAULT NULL,
119+
PRIMARY KEY (`id`),
120+
KEY `severity` (`severity`),
121+
KEY `hostname` (`hostname`)
120122
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
121123

122124

123-
124125
# Dump of table users
125126
# ------------------------------------------------------------
126127

db/UPDATE.SQL

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ ALTER TABLE `users` CHANGE `role` `role` SET('user','operator','administrator')
77
-- add hostnames to filter permitted hosts
88
ALTER TABLE `users` ADD `hostnames` text COLLATE utf8_bin NOT NULL;
99

10+
11+
/* @version 0.2.1 */
12+
ALTER TABLE `traps` ADD INDEX `severity` (`severity`);
13+
ALTER TABLE `traps` ADD INDEX `hostname` (`hostname`);

0 commit comments

Comments
 (0)