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
ebad9cb5
Commit
ebad9cb5
authored
Mar 07, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed gofmt formating, updated precommit hook
parent
d8005af8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
33 deletions
+40
-33
.hooks/pre-commit
+7
-0
pkg/services/sqlstore/migrations/user_mig.go
+32
-32
pkg/services/sqlstore/stars_test.go
+1
-1
No files found.
.hooks/pre-commit
0 → 100755
View file @
ebad9cb5
#!/usr/bin/env bash
test
-z
"
$(
gofmt
-s
-l
.
|
grep
-v
Godeps/_workspace/src/ | tee /dev/stderr
)
"
if
[
$?
-gt
0
]
;
then
echo
"Some files aren't formatted, please run 'go fmt ./pkg/...' to format your source code before committing"
exit
1
fi
pkg/services/sqlstore/migrations/user_mig.go
View file @
ebad9cb5
...
...
@@ -6,23 +6,23 @@ func addUserMigrations(mg *Migrator) {
userV1
:=
Table
{
Name
:
"user"
,
Columns
:
[]
*
Column
{
&
Column
{
Name
:
"id"
,
Type
:
DB_BigInt
,
IsPrimaryKey
:
true
,
IsAutoIncrement
:
true
},
&
Column
{
Name
:
"version"
,
Type
:
DB_Int
,
Nullable
:
false
},
&
Column
{
Name
:
"login"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
&
Column
{
Name
:
"email"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
&
Column
{
Name
:
"name"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"password"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"salt"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
&
Column
{
Name
:
"rands"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
&
Column
{
Name
:
"company"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"account_id"
,
Type
:
DB_BigInt
,
Nullable
:
false
},
&
Column
{
Name
:
"is_admin"
,
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
:
"version"
,
Type
:
DB_Int
,
Nullable
:
false
},
{
Name
:
"login"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
{
Name
:
"email"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
{
Name
:
"name"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"password"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"salt"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
{
Name
:
"rands"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
{
Name
:
"company"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"account_id"
,
Type
:
DB_BigInt
,
Nullable
:
false
},
{
Name
:
"is_admin"
,
Type
:
DB_Bool
,
Nullable
:
false
},
{
Name
:
"created"
,
Type
:
DB_DateTime
,
Nullable
:
false
},
{
Name
:
"updated"
,
Type
:
DB_DateTime
,
Nullable
:
false
},
},
Indices
:
[]
*
Index
{
&
Index
{
Cols
:
[]
string
{
"login"
},
Type
:
UniqueIndex
},
&
Index
{
Cols
:
[]
string
{
"email"
},
Type
:
UniqueIndex
},
{
Cols
:
[]
string
{
"login"
},
Type
:
UniqueIndex
},
{
Cols
:
[]
string
{
"email"
},
Type
:
UniqueIndex
},
},
}
...
...
@@ -45,25 +45,25 @@ func addUserMigrations(mg *Migrator) {
userV2
:=
Table
{
Name
:
"user"
,
Columns
:
[]
*
Column
{
&
Column
{
Name
:
"id"
,
Type
:
DB_BigInt
,
IsPrimaryKey
:
true
,
IsAutoIncrement
:
true
},
&
Column
{
Name
:
"version"
,
Type
:
DB_Int
,
Nullable
:
false
},
&
Column
{
Name
:
"login"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
&
Column
{
Name
:
"email"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
&
Column
{
Name
:
"name"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"password"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"salt"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
&
Column
{
Name
:
"rands"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
&
Column
{
Name
:
"company"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
&
Column
{
Name
:
"org_id"
,
Type
:
DB_BigInt
,
Nullable
:
false
},
&
Column
{
Name
:
"is_admin"
,
Type
:
DB_Bool
,
Nullable
:
false
},
&
Column
{
Name
:
"email_verified"
,
Type
:
DB_Bool
,
Nullable
:
true
},
&
Column
{
Name
:
"theme"
,
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
:
"login"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
{
Name
:
"email"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
false
},
{
Name
:
"name"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"password"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"salt"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
{
Name
:
"rands"
,
Type
:
DB_NVarchar
,
Length
:
50
,
Nullable
:
true
},
{
Name
:
"company"
,
Type
:
DB_NVarchar
,
Length
:
255
,
Nullable
:
true
},
{
Name
:
"org_id"
,
Type
:
DB_BigInt
,
Nullable
:
false
},
{
Name
:
"is_admin"
,
Type
:
DB_Bool
,
Nullable
:
false
},
{
Name
:
"email_verified"
,
Type
:
DB_Bool
,
Nullable
:
true
},
{
Name
:
"theme"
,
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
{
"login"
},
Type
:
UniqueIndex
},
&
Index
{
Cols
:
[]
string
{
"email"
},
Type
:
UniqueIndex
},
{
Cols
:
[]
string
{
"login"
},
Type
:
UniqueIndex
},
{
Cols
:
[]
string
{
"email"
},
Type
:
UniqueIndex
},
},
}
...
...
pkg/services/sqlstore/stars_test.go
View file @
ebad9cb5
...
...
@@ -3,8 +3,8 @@ package sqlstore
import
(
"testing"
.
"github.com/smartystreets/goconvey/convey"
m
"github.com/grafana/grafana/pkg/models"
.
"github.com/smartystreets/goconvey/convey"
)
func
TestUserStarsDataAccess
(
t
*
testing
.
T
)
{
...
...
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