mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix notification channel migration and handle case when Alertmanager default configuration is absent (#35086)
* Fix dashboard alert and nootifier migration for MySQL * Fix POSTing Alertmanager configuration if no current configuration exists in case the default configuration has not be stored yet or has failed to get stored * Change CreatedAt field type
This commit is contained in:
committed by
GitHub
parent
c13f247a94
commit
15c55b0115
@@ -2,6 +2,7 @@ package ualert
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -30,7 +31,7 @@ SELECT id,
|
||||
name,
|
||||
message,
|
||||
frequency,
|
||||
for,
|
||||
%s,
|
||||
state,
|
||||
settings
|
||||
FROM
|
||||
@@ -43,7 +44,7 @@ FROM
|
||||
// ParsedSettings property of the dash alert.
|
||||
func (m *migration) slurpDashAlerts() ([]dashAlert, error) {
|
||||
dashAlerts := []dashAlert{}
|
||||
err := m.sess.SQL(slurpDashSQL).Find(&dashAlerts)
|
||||
err := m.sess.SQL(fmt.Sprintf(slurpDashSQL, m.mg.Dialect.Quote("for"))).Find(&dashAlerts)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user