feat(alerting): add triggeredAlerts as json to alert_state

This commit is contained in:
bergquist
2016-06-23 11:14:40 +02:00
parent 488b42377b
commit 67197d54f9
5 changed files with 27 additions and 23 deletions

View File

@@ -51,11 +51,12 @@ func SetNewAlertState(cmd *m.UpdateAlertStateCommand) error {
sess.Id(alert.Id).Update(&alert)
alertState := m.AlertState{
AlertId: cmd.AlertId,
OrgId: cmd.OrgId,
NewState: cmd.NewState,
Info: cmd.Info,
Created: time.Now(),
AlertId: cmd.AlertId,
OrgId: cmd.OrgId,
NewState: cmd.NewState,
Info: cmd.Info,
Created: time.Now(),
TriggeredAlerts: cmd.TriggeredAlerts,
}
sess.Insert(&alertState)

View File

@@ -49,6 +49,7 @@ func addAlertMigrations(mg *Migrator) {
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "new_state", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "info", Type: DB_Text, Nullable: true},
{Name: "triggered_alerts", Type: DB_Text, Nullable: true},
{Name: "created", Type: DB_DateTime, Nullable: false},
},
}