Alerting: add collision safe update function for alertmanager configurations (#46692)

* Alerting: add collision safe update function for alertmanager configurations

* fix typo

* use bootstrap func for tests

* move hash calculation to store

* remove icons lol

* remove removed field
This commit is contained in:
Jean-Philippe Quéméner
2022-03-23 09:31:46 +01:00
committed by GitHub
parent ff3c1e3144
commit a80f04c949
6 changed files with 141 additions and 0 deletions
@@ -306,6 +306,10 @@ func AddAlertmanagerConfigMigrations(mg *migrator.Migrator) {
mg.AddMigration("add index in alert_configuration table on org_id column", migrator.NewAddIndexMigration(alertConfiguration, &migrator.Index{
Cols: []string{"org_id"},
}))
mg.AddMigration("add configuration_hash column to alert_configuration", migrator.NewAddColumnMigration(alertConfiguration, &migrator.Column{
Name: "configuration_hash", Type: migrator.DB_Varchar, Nullable: false, Default: "'not-yet-calculated'", Length: 32,
}))
}
func AddAlertAdminConfigMigrations(mg *migrator.Migrator) {