feat(alerting): add migration for create and update

This commit is contained in:
bergquist
2016-05-20 14:23:24 +02:00
parent 402499c071
commit 9d016a2756
4 changed files with 13 additions and 12 deletions

View File

@@ -21,7 +21,6 @@ func init() {
func GetAlertById(query *m.GetAlertByIdQuery) error {
alert := m.AlertRule{}
has, err := x.Id(query.Id).Get(&alert)
if !has {
return fmt.Errorf("could not find alert")
}

View File

@@ -22,6 +22,8 @@ func addAlertMigrations(mg *Migrator) {
{Name: "query_range", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "aggregator", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
}