delete duplicate alerts as part of 0.10.2 migrations

This commit is contained in:
henrygd
2025-03-14 23:03:07 -04:00
parent edefc6f53e
commit cadc09b493

View File

@@ -7,6 +7,17 @@ import (
func init() { func init() {
m.Register(func(app core.App) error { m.Register(func(app core.App) error {
// delete duplicate alerts
app.DB().NewQuery(`
DELETE FROM alerts
WHERE rowid NOT IN (
SELECT MAX(rowid)
FROM alerts
GROUP BY user, system, name
);
`).Execute()
// import collections
jsonData := `[ jsonData := `[
{ {
"id": "elngm8x1l60zi2v", "id": "elngm8x1l60zi2v",