mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore(alerting): struct names and url refactoring
This commit is contained in:
@@ -32,7 +32,7 @@ func SetNewAlertState(cmd *m.UpdateAlertStateCommand) error {
|
||||
alert.State = cmd.NewState
|
||||
sess.Id(alert.Id).Update(&alert)
|
||||
|
||||
log := m.AlertStateLog{
|
||||
log := m.AlertState{
|
||||
AlertId: cmd.AlertId,
|
||||
OrgId: cmd.AlertId,
|
||||
NewState: cmd.NewState,
|
||||
@@ -47,8 +47,8 @@ func SetNewAlertState(cmd *m.UpdateAlertStateCommand) error {
|
||||
})
|
||||
}
|
||||
|
||||
func GetAlertStateLogByAlertId(cmd *m.GetAlertsStateLogCommand) error {
|
||||
alertLogs := make([]m.AlertStateLog, 0)
|
||||
func GetAlertStateLogByAlertId(cmd *m.GetAlertsStateCommand) error {
|
||||
alertLogs := make([]m.AlertState, 0)
|
||||
|
||||
if err := x.Where("alert_id = ?", cmd.AlertId).Desc("created").Find(&alertLogs); err != nil {
|
||||
return err
|
||||
|
||||
@@ -82,7 +82,7 @@ func TestAlertingStateAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("should have two event state logs", func() {
|
||||
query := &m.GetAlertsStateLogCommand{
|
||||
query := &m.GetAlertsStateCommand{
|
||||
AlertId: 1,
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ func addAlertMigrations(mg *Migrator) {
|
||||
mg.AddMigration("create alert_rules_updates table v1", NewAddTableMigration(alert_changes))
|
||||
|
||||
alert_state_log := Table{
|
||||
Name: "alert_state_log",
|
||||
Name: "alert_state",
|
||||
Columns: []*Column{
|
||||
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
|
||||
{Name: "alert_id", Type: DB_BigInt, Nullable: false},
|
||||
|
||||
Reference in New Issue
Block a user