Database: Adds new indices to alert_notification_state and alert_rule_tag tables (#28166)

Add non-unique indices to alert_notification_state and alert_rule_tag tables for 
column alert_id.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Fixes #22890
This commit is contained in:
Karine Valença 2020-10-13 08:51:54 -03:00 committed by GitHub
parent 0a58ecbacd
commit e1e05cad7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,4 +175,12 @@ func addAlertMigrations(mg *Migrator) {
// change column type of alert.settings
mg.AddMigration("alter alert.settings to mediumtext", NewRawSqlMigration("").
Mysql("ALTER TABLE alert MODIFY settings MEDIUMTEXT;"))
mg.AddMigration("Add non-unique index alert_notification_state_alert_id", NewAddIndexMigration(alert_notification_state, &Index{
Cols: []string{"alert_id"}, Type: IndexType,
}))
mg.AddMigration("Add non-unique index alert_rule_tag_alert_id", NewAddIndexMigration(alertRuleTagTable, &Index{
Cols: []string{"alert_id"}, Type: IndexType,
}))
}