Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d8005af8
Commit
d8005af8
authored
Mar 07, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated circle with fmt formating test
parent
ba3ba0ac
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
113 deletions
+117
-113
circle.yml
+4
-0
pkg/services/eventpublisher/eventpublisher.go
+1
-1
pkg/services/sqlstore/migrations/apikey_mig.go
+20
-20
pkg/services/sqlstore/migrations/dashboard_mig.go
+24
-24
pkg/services/sqlstore/migrations/datasource_mig.go
+37
-37
pkg/services/sqlstore/migrations/migrations.go
+10
-10
pkg/services/sqlstore/migrations/org_mig.go
+21
-21
No files found.
circle.yml
View file @
d8005af8
...
...
@@ -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
pkg/services/eventpublisher/eventpublisher.go
View file @
d8005af8
...
...
@@ -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
(
...
...
pkg/services/sqlstore/migrations/apikey_mig.go
View file @
d8005af8
...
...
@@ -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
},
},
}
...
...
pkg/services/sqlstore/migrations/dashboard_mig.go
View file @
d8005af8
...
...
@@ -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
},
},
}
...
...
pkg/services/sqlstore/migrations/datasource_mig.go
View file @
d8005af8
...
...
@@ -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
},
},
}
...
...
pkg/services/sqlstore/migrations/migrations.go
View file @
d8005af8
...
...
@@ -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
},
},
}
...
...
pkg/services/sqlstore/migrations/org_mig.go
View file @
d8005af8
...
...
@@ -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
},
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment