feat(alerting): add datasource ref to alert rule

This commit is contained in:
bergquist
2016-05-25 12:57:49 +02:00
parent 0f58f8a679
commit b2a4d8083e
8 changed files with 122 additions and 61 deletions
@@ -11,7 +11,7 @@ func addAlertMigrations(mg *Migrator) {
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
//{Name: "datasource_id", Type: DB_BigInt, Nullable: false},
{Name: "datasource_id", Type: DB_BigInt, Nullable: false},
{Name: "panel_id", Type: DB_BigInt, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "query", Type: DB_Text, Nullable: false},
@@ -8,6 +8,7 @@ import (
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
. "github.com/smartystreets/goconvey/convey"
//"github.com/grafana/grafana/pkg/log"
)
var indexTypes = []string{"Unknown", "INDEX", "UNIQUE INDEX"}
@@ -28,7 +29,7 @@ func TestMigrations(t *testing.T) {
sqlutil.CleanDB(x)
mg := NewMigrator(x)
//mg.LogLevel = log.DEBUG
//mg.LogLevel = log.ERROR
AddMigrations(mg)
err = mg.Start()