mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Change rule migration to be based on feature flag (#33792)
makes it so the feature flag can be turned on off, and the migration will be cleared and rerun. All existing NG alert rules, configuration settings, etc are removed when disabling the feature flag. for https://github.com/grafana/alerting-squad/issues/142 Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
This commit is contained in:
@@ -44,7 +44,6 @@ func (m *migration) createFolder(orgID int64, title string) (*dashboard, error)
|
||||
}),
|
||||
}
|
||||
dash := cmd.getDashboardModel()
|
||||
var userId int64 = -1
|
||||
|
||||
uid, err := m.generateNewDashboardUid(dash.OrgId)
|
||||
if err != nil {
|
||||
@@ -55,9 +54,9 @@ func (m *migration) createFolder(orgID int64, title string) (*dashboard, error)
|
||||
parentVersion := dash.Version
|
||||
dash.setVersion(1)
|
||||
dash.Created = time.Now()
|
||||
dash.CreatedBy = userId
|
||||
dash.CreatedBy = FOLDER_CREATED_BY
|
||||
dash.Updated = time.Now()
|
||||
dash.UpdatedBy = userId
|
||||
dash.UpdatedBy = FOLDER_CREATED_BY
|
||||
metrics.MApiDashboardInsert.Inc()
|
||||
|
||||
if _, err = m.sess.Insert(dash); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user