This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Alerts are ignored if the related rule is not active * Alerts of resetType "Manual" trigger only actions if there is no existing unsuppressed alert with state "New" * If Alerts are not triggering but valid, they are stored in DB as suppressed events * GUI is only showing active, i.e. non-suppressed event * URI parameter "active=true" can be used to get only non-suppressed event. Default behavior is to provide all events. * Introduced new DB upgrade logic with sequelize migrations * Updated createDB script to terminate correctly * Added upgradeDB script which can be used by Helm to upgrade DB Signed-off-by: Marcel Wagner <wagmarcel@web.de>
- Loading branch information
Showing
11 changed files
with
245 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const config = require('../config'); | ||
const { exec } = require('child_process'); | ||
|
||
var UpdateDB = function(){}; | ||
|
||
UpdateDB.prototype.update = function(test) { | ||
var database = config.postgres.database; | ||
if (test === "test") { | ||
database = "test"; | ||
} | ||
|
||
var cdCommand = "cd /app/iot-entities/postgresql;"; | ||
var dbupdateCommand = "npx sequelize-cli db:migrate --url postgres://" + | ||
config.postgres.su_username + | ||
":" + config.postgres.su_password + | ||
"@" + config.postgres.options.replication.write.host + | ||
"/" + database; | ||
console.log("Executing " + cdCommand + dbupdateCommand); | ||
exec(cdCommand + dbupdateCommand, (err, stdout, stderr) => { | ||
if (err) { | ||
console.log("Error: ", err); | ||
process.exit(1); | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
console.log(`stderr: ${stderr}`); | ||
process.exit(0); | ||
}); | ||
}; | ||
|
||
module.exports = UpdateDB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.