[v9.4.x] Alerting: Migration to not fail if alert_configuration table is not empty (#68404)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-05-12 20:30:27 +01:00
committed by GitHub
parent ec973b648a
commit f5da579af9
@@ -455,6 +455,9 @@ func (m *migration) writeAlertmanagerConfig(orgID int64, amConfig *PostableUserC
return err
}
// remove an existing configuration, which could have been left during switching back to legacy alerting
_, _ = m.sess.Delete(AlertConfiguration{OrgID: orgID})
// We don't need to apply the configuration, given the multi org alertmanager will do an initial sync before the server is ready.
_, err = m.sess.Insert(AlertConfiguration{
AlertmanagerConfiguration: string(rawAmConfig),