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
07aa9566
Unverified
Commit
07aa9566
authored
Jan 13, 2021
by
Tom Wilkie
Committed by
GitHub
Jan 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option in database config to skip migrations for faster startup. (#30146)
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
parent
bfcb8a47
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
pkg/services/sqlstore/sqlstore.go
+4
-0
No files found.
pkg/services/sqlstore/sqlstore.go
View file @
07aa9566
...
@@ -87,6 +87,7 @@ func (ss *SQLStore) Init() error {
...
@@ -87,6 +87,7 @@ func (ss *SQLStore) Init() error {
x
=
ss
.
engine
x
=
ss
.
engine
dialect
=
ss
.
Dialect
dialect
=
ss
.
Dialect
if
!
ss
.
dbCfg
.
SkipMigrations
{
migrator
:=
migrator
.
NewMigrator
(
ss
.
engine
)
migrator
:=
migrator
.
NewMigrator
(
ss
.
engine
)
migrations
.
AddMigrations
(
migrator
)
migrations
.
AddMigrations
(
migrator
)
...
@@ -100,6 +101,7 @@ func (ss *SQLStore) Init() error {
...
@@ -100,6 +101,7 @@ func (ss *SQLStore) Init() error {
if
err
:=
migrator
.
Start
();
err
!=
nil
{
if
err
:=
migrator
.
Start
();
err
!=
nil
{
return
err
return
err
}
}
}
// Init repo instances
// Init repo instances
annotations
.
SetRepository
(
&
SQLAnnotationRepo
{})
annotations
.
SetRepository
(
&
SQLAnnotationRepo
{})
...
@@ -388,6 +390,7 @@ func (ss *SQLStore) readConfig() {
...
@@ -388,6 +390,7 @@ func (ss *SQLStore) readConfig() {
ss
.
dbCfg
.
Path
=
sec
.
Key
(
"path"
)
.
MustString
(
"data/grafana.db"
)
ss
.
dbCfg
.
Path
=
sec
.
Key
(
"path"
)
.
MustString
(
"data/grafana.db"
)
ss
.
dbCfg
.
CacheMode
=
sec
.
Key
(
"cache_mode"
)
.
MustString
(
"private"
)
ss
.
dbCfg
.
CacheMode
=
sec
.
Key
(
"cache_mode"
)
.
MustString
(
"private"
)
ss
.
dbCfg
.
SkipMigrations
=
sec
.
Key
(
"skip_migrations"
)
.
MustBool
()
}
}
// ITestDB is an interface of arguments for testing db
// ITestDB is an interface of arguments for testing db
...
@@ -525,4 +528,5 @@ type DatabaseConfig struct {
...
@@ -525,4 +528,5 @@ type DatabaseConfig struct {
ConnMaxLifetime
int
ConnMaxLifetime
int
CacheMode
string
CacheMode
string
UrlQueryParams
map
[
string
][]
string
UrlQueryParams
map
[
string
][]
string
SkipMigrations
bool
}
}
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