mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 10:19:27 +08:00
delete duplicate alerts as part of 0.10.2 migrations
This commit is contained in:
@@ -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",
|
||||||
|
Reference in New Issue
Block a user