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
ab99a7c1
Commit
ab99a7c1
authored
Apr 13, 2017
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph(create annotation): add initial annotation_category table
parent
2142323d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
pkg/services/sqlstore/migrations/annotation_category_mig.go
+26
-0
pkg/services/sqlstore/migrations/migrations.go
+1
-0
No files found.
pkg/services/sqlstore/migrations/annotation_category_mig.go
0 → 100644
View file @
ab99a7c1
package
migrations
import
(
.
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func
addAnnotationCategoryMig
(
mg
*
Migrator
)
{
category
:=
Table
{
Name
:
"annotation_category"
,
Columns
:
[]
*
Column
{
{
Name
:
"id"
,
Type
:
DB_BigInt
,
IsPrimaryKey
:
true
,
IsAutoIncrement
:
true
},
{
Name
:
"org_id"
,
Type
:
DB_BigInt
,
Nullable
:
false
},
{
Name
:
"user_id"
,
Type
:
DB_BigInt
,
Nullable
:
true
},
{
Name
:
"name"
,
Type
:
DB_Text
,
Nullable
:
false
},
},
Indices
:
[]
*
Index
{
{
Cols
:
[]
string
{
"org_id"
,
"name"
},
Type
:
IndexType
},
},
}
// create table
mg
.
AddMigration
(
"create annotation_category table"
,
NewAddTableMigration
(
category
))
// create indices
mg
.
AddMigration
(
"add index org_id & name"
,
NewAddIndexMigration
(
category
,
category
.
Indices
[
0
]))
}
pkg/services/sqlstore/migrations/migrations.go
View file @
ab99a7c1
...
...
@@ -26,6 +26,7 @@ func AddMigrations(mg *Migrator) {
addAnnotationMig
(
mg
)
addStatsMigrations
(
mg
)
addTestDataMigrations
(
mg
)
// addAnnotationCategoryMig(mg)
}
func
addMigrationLogMigrations
(
mg
*
Migrator
)
{
...
...
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