summaryrefslogtreecommitdiffstats
path: root/modules-available/eventlog/install.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/eventlog/install.inc.php')
-rw-r--r--modules-available/eventlog/install.inc.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/modules-available/eventlog/install.inc.php b/modules-available/eventlog/install.inc.php
index f6057d23..def608aa 100644
--- a/modules-available/eventlog/install.inc.php
+++ b/modules-available/eventlog/install.inc.php
@@ -41,12 +41,16 @@ $res[] = tableCreate('notification_rule_x_transport', '
KEY (`transportid`)
');
-$res[] = tableCreate('notification_sample', '
- `type` varchar(40) CHARACTER SET ascii NOT NULL,
+$res[] = tableCreate('notification_sample', "
+ `sampleid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`dateline` int(10) UNSIGNED NOT NULL,
+ `extended` tinyint(1) NOT NULL DEFAULT '0',
+ `type` varchar(40) CHARACTER SET ascii NOT NULL,
`data` mediumblob,
- KEY (`type`, `dateline`)
-');
+ KEY (`type`, `dateline`),
+ KEY (`extended`),
+ PRIMARY KEY (`sampleid`)
+");
// Update path
@@ -63,6 +67,18 @@ $res[] = tableAddConstraint('notification_rule_x_transport', 'ruleid',
$res[] = tableAddConstraint('notification_rule_x_transport', 'transportid',
'notification_backend', 'transportid', 'ON UPDATE CASCADE ON DELETE CASCADE');
+// 2022-07-20: Add flag to see if notification_sample has been extended
+if (!tableHasColumn('notification_sample', 'extended')) {
+ if (Database::exec("ALTER TABLE notification_sample
+ ADD COLUMN `extended` tinyint(1) NOT NULL DEFAULT '0',
+ ADD KEY (`extended`),
+ ADD COLUMN `sampleid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ ADD PRIMARY KEY (`sampleid`)") === false) {
+ finalResponse(UPDATE_FAILED, 'Could not add extended flag to notification_sample: ' . Database::lastError());
+ }
+ $res[] = UPDATE_DONE;
+}
+
// Create response for browser
if (in_array(UPDATE_DONE, $res)) {