mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:22:29 +08:00
Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102347)
This commit is contained in:

committed by
GitHub

parent
1d0a86252e
commit
9491fa1895
@ -149,4 +149,6 @@ func (oss *OSSMigrations) AddMigration(mg *Migrator) {
|
||||
ualert.AddAlertRuleGuidMigration(mg)
|
||||
|
||||
ualert.AddAlertRuleMissingSeriesEvalsToResolve(mg)
|
||||
|
||||
ualert.AddAlertRuleVersionUIDIndex(mg)
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package ualert
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
)
|
||||
|
||||
// AddAlertRuleVersionUIDIndex adds an index to the alert_rule_version table on (rule_org_id, rule_uid) columns.
|
||||
func AddAlertRuleVersionUIDIndex(mg *migrator.Migrator) {
|
||||
mg.AddMigration("add index to alert_rule_version table on (rule_org_id, rule_uid)",
|
||||
migrator.NewAddIndexMigration(
|
||||
migrator.Table{Name: "alert_rule_version"},
|
||||
&migrator.Index{Cols: []string{"rule_org_id", "rule_uid"}, Type: migrator.IndexType},
|
||||
),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user