[release-11.6.0] Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102353)
Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102347)
(cherry picked from commit 9491fa1895)
This commit is contained in:
committed by
GitHub
parent
9f280bd5c4
commit
c3a547e1c9
@@ -147,4 +147,6 @@ func (oss *OSSMigrations) AddMigration(mg *Migrator) {
|
||||
ualert.AddAlertRuleStateTable(mg)
|
||||
|
||||
ualert.AddAlertRuleGuidMigration(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