Commit d8005af8 by Torkel Ödegaard

updated circle with fmt formating test

parent ba3ba0ac
......@@ -14,5 +14,9 @@ dependencies:
test:
override:
# FMT
- test -z "$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)"
# Go lang test
- godep go test -v ./pkg/...
# js tests
- ./node_modules/grunt-cli/bin/grunt test
......@@ -6,10 +6,10 @@ import (
"log"
"time"
"github.com/streadway/amqp"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/events"
"github.com/grafana/grafana/pkg/setting"
"github.com/streadway/amqp"
)
var (
......
......@@ -6,18 +6,18 @@ func addApiKeyMigrations(mg *Migrator) {
apiKeyV1 := Table{
Name: "api_key",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "account_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "key", Type: DB_Varchar, Length: 64, Nullable: false},
&Column{Name: "role", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "account_id", Type: DB_BigInt, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "key", Type: DB_Varchar, Length: 64, Nullable: false},
{Name: "role", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"account_id"}},
&Index{Cols: []string{"key"}, Type: UniqueIndex},
&Index{Cols: []string{"account_id", "name"}, Type: UniqueIndex},
{Cols: []string{"account_id"}},
{Cols: []string{"key"}, Type: UniqueIndex},
{Cols: []string{"account_id", "name"}, Type: UniqueIndex},
},
}
......@@ -39,18 +39,18 @@ func addApiKeyMigrations(mg *Migrator) {
apiKeyV2 := Table{
Name: "api_key",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "org_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "key", Type: DB_Varchar, Length: 64, Nullable: false},
&Column{Name: "role", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "key", Type: DB_Varchar, Length: 64, Nullable: false},
{Name: "role", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"org_id"}},
&Index{Cols: []string{"key"}, Type: UniqueIndex},
&Index{Cols: []string{"org_id", "name"}, Type: UniqueIndex},
{Cols: []string{"org_id"}},
{Cols: []string{"key"}, Type: UniqueIndex},
{Cols: []string{"org_id", "name"}, Type: UniqueIndex},
},
}
......
......@@ -6,18 +6,18 @@ func addDashboardMigration(mg *Migrator) {
var dashboardV1 = Table{
Name: "dashboard",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "version", Type: DB_Int, Nullable: false},
&Column{Name: "slug", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "data", Type: DB_Text, Nullable: false},
&Column{Name: "account_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "slug", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "data", Type: DB_Text, Nullable: false},
{Name: "account_id", Type: DB_BigInt, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"account_id"}},
&Index{Cols: []string{"account_id", "slug"}, Type: UniqueIndex},
{Cols: []string{"account_id"}},
{Cols: []string{"account_id", "slug"}, Type: UniqueIndex},
},
}
......@@ -30,12 +30,12 @@ func addDashboardMigration(mg *Migrator) {
dashboardTagV1 := Table{
Name: "dashboard_tag",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "term", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
{Name: "term", Type: DB_NVarchar, Length: 50, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"dashboard_id", "term"}, Type: UniqueIndex},
{Cols: []string{"dashboard_id", "term"}, Type: UniqueIndex},
},
}
......@@ -54,18 +54,18 @@ func addDashboardMigration(mg *Migrator) {
var dashboardV2 = Table{
Name: "dashboard",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "version", Type: DB_Int, Nullable: false},
&Column{Name: "slug", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "data", Type: DB_Text, Nullable: false},
&Column{Name: "org_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "slug", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "data", Type: DB_Text, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"org_id"}},
&Index{Cols: []string{"org_id", "slug"}, Type: UniqueIndex},
{Cols: []string{"org_id"}},
{Cols: []string{"org_id", "slug"}, Type: UniqueIndex},
},
}
......
......@@ -6,26 +6,26 @@ func addDataSourceMigration(mg *Migrator) {
var tableV1 = Table{
Name: "data_source",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "account_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "version", Type: DB_Int, Nullable: false},
&Column{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "basic_auth", Type: DB_Bool, Nullable: false},
&Column{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "is_default", Type: DB_Bool, Nullable: false},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "account_id", Type: DB_BigInt, Nullable: false},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "basic_auth", Type: DB_Bool, Nullable: false},
{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "is_default", Type: DB_Bool, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"account_id"}},
&Index{Cols: []string{"account_id", "name"}, Type: UniqueIndex},
{Cols: []string{"account_id"}},
{Cols: []string{"account_id", "name"}, Type: UniqueIndex},
},
}
......@@ -45,27 +45,27 @@ func addDataSourceMigration(mg *Migrator) {
var tableV2 = Table{
Name: "data_source",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "org_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "version", Type: DB_Int, Nullable: false},
&Column{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "basic_auth", Type: DB_Bool, Nullable: false},
&Column{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "is_default", Type: DB_Bool, Nullable: false},
&Column{Name: "json_data", Type: DB_Text, Nullable: true},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "basic_auth", Type: DB_Bool, Nullable: false},
{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "is_default", Type: DB_Bool, Nullable: false},
{Name: "json_data", Type: DB_Text, Nullable: true},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"org_id"}},
&Index{Cols: []string{"org_id", "name"}, Type: UniqueIndex},
{Cols: []string{"org_id"}},
{Cols: []string{"org_id", "name"}, Type: UniqueIndex},
},
}
......
......@@ -21,12 +21,12 @@ func addMigrationLogMigrations(mg *Migrator) {
migrationLogV1 := Table{
Name: "migration_log",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "migration_id", Type: DB_NVarchar, Length: 255},
&Column{Name: "sql", Type: DB_Text},
&Column{Name: "success", Type: DB_Bool},
&Column{Name: "error", Type: DB_Text},
&Column{Name: "timestamp", Type: DB_DateTime},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "migration_id", Type: DB_NVarchar, Length: 255},
{Name: "sql", Type: DB_Text},
{Name: "success", Type: DB_Bool},
{Name: "error", Type: DB_Text},
{Name: "timestamp", Type: DB_DateTime},
},
}
......@@ -37,12 +37,12 @@ func addStarMigrations(mg *Migrator) {
starV1 := Table{
Name: "star",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "user_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "user_id", Type: DB_BigInt, Nullable: false},
{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"user_id", "dashboard_id"}, Type: UniqueIndex},
{Cols: []string{"user_id", "dashboard_id"}, Type: UniqueIndex},
},
}
......
......@@ -6,21 +6,21 @@ func addOrgMigrations(mg *Migrator) {
orgV1 := Table{
Name: "org",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "version", Type: DB_Int, Nullable: false},
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
&Column{Name: "address1", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "address2", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "city", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "zip_code", Type: DB_NVarchar, Length: 50, Nullable: true},
&Column{Name: "country", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "billing_email", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "address1", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "address2", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "city", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "zip_code", Type: DB_NVarchar, Length: 50, Nullable: true},
{Name: "country", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "billing_email", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Indices: []*Index{
&Index{Cols: []string{"name"}, Type: UniqueIndex},
{Cols: []string{"name"}, Type: UniqueIndex},
},
}
......@@ -31,16 +31,16 @@ func addOrgMigrations(mg *Migrator) {
orgUserV1 := Table{
Name: "org_user",
Columns: []*Column{
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
&Column{Name: "org_id", Type: DB_BigInt},
&Column{Name: "user_id", Type: DB_BigInt},
&Column{Name: "role", Type: DB_NVarchar, Length: 20},
&Column{Name: "created", Type: DB_DateTime},
&Column{Name: "updated", Type: DB_DateTime},
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt},
{Name: "user_id", Type: DB_BigInt},
{Name: "role", Type: DB_NVarchar, Length: 20},
{Name: "created", Type: DB_DateTime},
{Name: "updated", Type: DB_DateTime},
},
Indices: []*Index{
&Index{Cols: []string{"org_id"}},
&Index{Cols: []string{"org_id", "user_id"}, Type: UniqueIndex},
{Cols: []string{"org_id"}},
{Cols: []string{"org_id", "user_id"}, Type: UniqueIndex},
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment