Alerting: Migration to not fail if alert_configuration table is not empty (#67924)

pull/67954/head
Yuri Tseretyan 2 years ago committed by GitHub
parent 9d16718acc
commit 0ce7f7eaf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/services/sqlstore/migrations/ualert/ualert.go

@ -457,6 +457,9 @@ func (m *migration) writeAlertmanagerConfig(orgID int64, amConfig *PostableUserC
return err 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. // 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{ _, err = m.sess.Insert(AlertConfiguration{
AlertmanagerConfiguration: string(rawAmConfig), AlertmanagerConfiguration: string(rawAmConfig),

Loading…
Cancel
Save