refactor(alerting): changes interval to string from int

This commit is contained in:
bergquist
2016-04-20 16:57:03 +02:00
parent 262821e7e7
commit 96e88ee84d
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ func TestAlertingDataAccess(t *testing.T) {
QueryRefId: "A",
WarnLevel: "> 30",
CritLevel: "> 50",
Interval: 10,
Interval: "10",
Title: "Alerting title",
Description: "Alerting description",
QueryRange: "5m",
@@ -45,7 +45,7 @@ func TestAlertingDataAccess(t *testing.T) {
alert, err2 := GetAlertsByDashboard(1, 1)
So(err2, ShouldBeNil)
So(alert.Interval, ShouldEqual, 10)
So(alert.Interval, ShouldEqual, "10")
So(alert.WarnLevel, ShouldEqual, "> 30")
So(alert.CritLevel, ShouldEqual, "> 50")
So(alert.Query, ShouldEqual, "Query")
@@ -15,7 +15,7 @@ func addAlertMigrations(mg *Migrator) {
{Name: "query_ref_id", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "warn_level", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "crit_level", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "interval", Type: DB_BigInt, Nullable: false},
{Name: "interval", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "query_range", Type: DB_NVarchar, Length: 255, Nullable: false},