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:
Kyle Brandt
2021-05-11 08:08:39 -04:00
committed by GitHub
parent ac44a679a7
commit dc3e17ba5b
5 changed files with 95 additions and 8 deletions

View File

@ -85,7 +85,7 @@ func (ss *SQLStore) Init() error {
dialect = ss.Dialect
if !ss.dbCfg.SkipMigrations {
migrator := migrator.NewMigrator(ss.engine)
migrator := migrator.NewMigrator(ss.engine, ss.Cfg)
migrations.AddMigrations(migrator)
for _, descriptor := range registry.GetServices() {