Skip to content

Commit

Permalink
Minor update to issue 103 to properly alter the incoming table for up…
Browse files Browse the repository at this point in the history
…grades
  • Loading branch information
cigamit committed Dec 26, 2019
1 parent 49c697c commit 43776eb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,17 @@ function syslog_check_upgrade() {
'default' => '',
'after' => 'id')
);
}

if (db_column_exists('syslog_incoming', 'date')) {
db_execute("ALTER TABLE syslog_incoming
DROP COLUMN date,
CHANGE COLUMN `time` logtime timestamp default '0000-00-00';");
}
if (db_column_exists('syslog_incoming', 'date')) {
db_execute("ALTER TABLE syslog_incoming
DROP COLUMN date,
CHANGE COLUMN `time` logtime timestamp default '0000-00-00';");
}

$alerts = syslog_db_fetch_assoc('SELECT * FROM syslog_alert WHERE hash IS NULL OR hash = ""');
$alerts = syslog_db_fetch_assoc('SELECT *
FROM syslog_alert
WHERE hash IS NULL OR hash = ""');

if (cacti_sizeof($alerts)) {
foreach($alerts as $a) {
Expand All @@ -296,7 +298,9 @@ function syslog_check_upgrade() {
}
}

$removes = syslog_db_fetch_assoc('SELECT * FROM syslog_remove WHERE hash IS NULL OR hash = ""');
$removes = syslog_db_fetch_assoc('SELECT *
FROM syslog_remove
WHERE hash IS NULL OR hash = ""');

if (cacti_sizeof($removes)) {
foreach($removes as $r) {
Expand All @@ -308,7 +312,9 @@ function syslog_check_upgrade() {
}
}

$reports = syslog_db_fetch_assoc('SELECT * FROM syslog_reports WHERE hash IS NULL OR hash = ""');
$reports = syslog_db_fetch_assoc('SELECT *
FROM syslog_reports
WHERE hash IS NULL OR hash = ""');

if (cacti_sizeof($reports)) {
foreach($reports as $r) {
Expand Down

0 comments on commit 43776eb

Please sign in to comment.