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
85260257
Commit
85260257
authored
Apr 23, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MySQL: Dashboard.data column type changed to mediumtext (sql migration added), Fixes #1863
parent
d92fae07
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
CHANGELOG.md
+1
-0
pkg/services/sqlstore/datasource_test.go
+2
-2
pkg/services/sqlstore/migrations/dashboard_mig.go
+6
-0
pkg/services/sqlstore/migrations/dashboard_snapshot_mig.go
+6
-0
pkg/services/sqlstore/migrator/migrations.go
+10
-2
No files found.
CHANGELOG.md
View file @
85260257
...
...
@@ -2,6 +2,7 @@
**Fixes**
-
[
Issue #1857
](
https://github.com/grafana/grafana/issues/1857
)
. /api/login/ping Fix for issue when behind reverse proxy and subpath
-
[
Issue #1863
](
https://github.com/grafana/grafana/issues/1863
)
. MySQL: Dashboard.data column type changed to mediumtext (sql migration added)
# 2.0.2 (2015-04-22)
...
...
pkg/services/sqlstore/datasource_test.go
View file @
85260257
...
...
@@ -14,9 +14,9 @@ import (
func
InitTestDB
(
t
*
testing
.
T
)
{
t
.
Log
(
"InitTestDB"
)
x
,
err
:=
xorm
.
NewEngine
(
sqlutil
.
TestDB_Sqlite3
.
DriverName
,
sqlutil
.
TestDB_Sqlite3
.
ConnStr
)
//
x, err := xorm.NewEngine(sqlutil.TestDB_Sqlite3.DriverName, sqlutil.TestDB_Sqlite3.ConnStr)
//x, err := xorm.NewEngine(sqlutil.TestDB_Mysql.DriverName, sqlutil.TestDB_Mysql.ConnStr)
//
x, err := xorm.NewEngine(sqlutil.TestDB_Postgres.DriverName, sqlutil.TestDB_Postgres.ConnStr)
x
,
err
:=
xorm
.
NewEngine
(
sqlutil
.
TestDB_Postgres
.
DriverName
,
sqlutil
.
TestDB_Postgres
.
ConnStr
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to init in memory sqllite3 db %v"
,
err
)
...
...
pkg/services/sqlstore/migrations/dashboard_mig.go
View file @
85260257
...
...
@@ -86,4 +86,10 @@ func addDashboardMigration(mg *Migrator) {
}))
mg
.
AddMigration
(
"drop table dashboard_v1"
,
NewDropTableMigration
(
"dashboard_v1"
))
// change column type of dashboard.data
mg
.
AddMigration
(
"alter dashboard.data to mediumtext v1"
,
new
(
RawSqlMigration
)
.
Sqlite
(
"SELECT 0 WHERE 0;"
)
.
Postgres
(
"SELECT 0;"
)
.
Mysql
(
"ALTER TABLE dashboard MODIFY data MEDIUMTEXT;"
))
}
pkg/services/sqlstore/migrations/dashboard_snapshot_mig.go
View file @
85260257
...
...
@@ -48,4 +48,10 @@ func addDashboardSnapshotMigrations(mg *Migrator) {
mg
.
AddMigration
(
"create dashboard_snapshot table v5 #2"
,
NewAddTableMigration
(
snapshotV5
))
addTableIndicesMigrations
(
mg
,
"v5"
,
snapshotV5
)
// ncrease data type
mg
.
AddMigration
(
"alter dashboard_snapshot.data to mediumtext v1"
,
new
(
RawSqlMigration
)
.
Sqlite
(
"SELECT 0 WHERE 0;"
)
.
Postgres
(
"SELECT 0;"
)
.
Mysql
(
"ALTER TABLE dashboard_snapshot.data MODIFY data MEDIUMTEXT;"
))
}
pkg/services/sqlstore/migrator/migrations.go
View file @
85260257
...
...
@@ -25,8 +25,9 @@ func (m *MigrationBase) GetCondition() MigrationCondition {
type
RawSqlMigration
struct
{
MigrationBase
sqlite
string
mysql
string
sqlite
string
mysql
string
postgres
string
}
func
(
m
*
RawSqlMigration
)
Sql
(
dialect
Dialect
)
string
{
...
...
@@ -35,6 +36,8 @@ func (m *RawSqlMigration) Sql(dialect Dialect) string {
return
m
.
mysql
case
SQLITE
:
return
m
.
sqlite
case
POSTGRES
:
return
m
.
postgres
}
panic
(
"db type not supported"
)
...
...
@@ -50,6 +53,11 @@ func (m *RawSqlMigration) Mysql(sql string) *RawSqlMigration {
return
m
}
func
(
m
*
RawSqlMigration
)
Postgres
(
sql
string
)
*
RawSqlMigration
{
m
.
postgres
=
sql
return
m
}
type
AddColumnMigration
struct
{
MigrationBase
tableName
string
...
...
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