Alerting: Mark AM configuration as applied (#61330)

* Mark AM configuration as applied

* add missing checks, make linter happy

* fix deadlock, mark as valid on save and on load

* mark configurations only if needed

* check error after applyConfig()

* code review comments

* code review changes

* more code review changes

* clean HistoricConfigFromAlertConfig function
This commit is contained in:
Santiago
2023-02-02 14:45:17 -03:00
committed by GitHub
parent 6ad1cfef38
commit ba731f7865
11 changed files with 287 additions and 64 deletions

View File

@@ -20,6 +20,10 @@ func AddTablesMigrations(mg *migrator.Migrator) {
// should come in the form of a new migration appended to the end of AddTablesMigrations
// instead of modifying an existing one. This ensure that tables are modified in a consistent and correct order.
historicalTableMigrations(mg)
mg.AddMigration("add last_applied column to alert_configuration_history", migrator.NewAddColumnMigration(migrator.Table{Name: "alert_configuration_history"}, &migrator.Column{
Name: "last_applied", Type: migrator.DB_Int, Nullable: false,
}))
}
// historicalTableMigrations contains those migrations that existed prior to creating the improved messaging around migration immutability.