diff options
author | Simon Rettberg | 2021-06-25 16:21:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-06-25 16:21:17 +0200 |
commit | 32f0677dbca9e3347b931c1d0105eb37aa57e90d (patch) | |
tree | ddad4562e7ee8439a24e2462d44614692bb71d14 /modules-available/eventlog/install.inc.php | |
parent | Update .idea (diff) | |
download | slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.tar.gz slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.tar.xz slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.zip |
[eventlog] Add event filtering and notification system
Diffstat (limited to 'modules-available/eventlog/install.inc.php')
-rw-r--r-- | modules-available/eventlog/install.inc.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules-available/eventlog/install.inc.php b/modules-available/eventlog/install.inc.php index e5fd32f6..3d252138 100644 --- a/modules-available/eventlog/install.inc.php +++ b/modules-available/eventlog/install.inc.php @@ -13,6 +13,41 @@ KEY `dateline` (`dateline`), KEY `logtypeid` (`logtypeid`,`dateline`) "); +$res[] = tableCreate('notification_rule', ' + `ruleid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(100) NOT NULL, + `description` text, + `type` varchar(40) NOT NULL CHARACTER SET ascii, + `datafilter` blob NOT NULL, + `subject` varchar(200) NOT NULL, + `message` text NOT NULL, + PRIMARY KEY (`ruleid`), + KEY `type` (`type`) +'); + +$res[] = tableCreate('notification_backend', ' + `transportid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(100) NOT NULL, + `description` text, + `data` blob, + PRIMARY KEY (`transportid`), + KEY (`title`) +'); + +$res[] = tableCreate('notification_rule_x_transport', ' + `ruleid` int(10) UNSIGNED NOT NULL, + `transportid` int(10) UNSIGNED NOT NULL, + PRIMARY KEY (`ruleid`, `transportid`), + KEY (`transportid`) +'); + +$res[] = tableCreate('notification_sample', ' + `type` varchar(40) CHARACTER SET ascii NOT NULL, + `dateline` int(10) UNSIGNED NOT NULL, + `data` blob, + KEY (`type`, `dateline`) +'); + // Update path if (!tableHasColumn('eventlog', 'extra')) { @@ -22,6 +57,12 @@ if (!tableHasColumn('eventlog', 'extra')) { $res[] = UPDATE_DONE; } +// 2021-06-15: Add constraints to filter/backend stuff +$res[] = tableAddConstraint('notification_rule_x_transport', 'ruleid', + 'notification_rule', 'ruleid', 'ON UPDATE CASCADE ON DELETE CASCADE'); +$res[] = tableAddConstraint('notification_rule_x_transport', 'transportid', + 'notification_backend', 'transportid', 'ON UPDATE CASCADE ON DELETE CASCADE'); + // Create response for browser if (in_array(UPDATE_DONE, $res)) { |