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
c7e3ed09
Commit
c7e3ed09
authored
Dec 14, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(postgres): fixes db migration issue with_credentials column for postgres, fixes #3505
parent
10f66fa7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
pkg/services/sqlstore/migrator/column.go
+1
-1
pkg/services/sqlstore/migrator/dialect.go
+6
-1
pkg/services/sqlstore/migrator/postgres_dialect.go
+11
-0
No files found.
pkg/services/sqlstore/migrator/column.go
View file @
c7e3ed09
...
...
@@ -55,7 +55,7 @@ func (col *Column) StringNoPk(d Dialect) string {
}
if
col
.
Default
!=
""
{
sql
+=
"DEFAULT "
+
col
.
Default
+
" "
sql
+=
"DEFAULT "
+
d
.
Default
(
col
)
+
" "
}
return
sql
...
...
pkg/services/sqlstore/migrator/dialect.go
View file @
c7e3ed09
...
...
@@ -17,10 +17,11 @@ type Dialect interface {
SqlType
(
col
*
Column
)
string
SupportEngine
()
bool
LikeStr
()
string
Default
(
col
*
Column
)
string
CreateIndexSql
(
tableName
string
,
index
*
Index
)
string
CreateTableSql
(
table
*
Table
)
string
AddColumnSql
(
tableName
string
,
C
ol
*
Column
)
string
AddColumnSql
(
tableName
string
,
c
ol
*
Column
)
string
CopyTableData
(
sourceTable
string
,
targetTable
string
,
sourceCols
[]
string
,
targetCols
[]
string
)
string
DropTable
(
tableName
string
)
string
DropIndexSql
(
tableName
string
,
index
*
Index
)
string
...
...
@@ -71,6 +72,10 @@ func (b *BaseDialect) EqStr() string {
return
"="
}
func
(
b
*
BaseDialect
)
Default
(
col
*
Column
)
string
{
return
col
.
Default
}
func
(
b
*
BaseDialect
)
CreateTableSql
(
table
*
Table
)
string
{
var
sql
string
sql
=
"CREATE TABLE IF NOT EXISTS "
...
...
pkg/services/sqlstore/migrator/postgres_dialect.go
View file @
c7e3ed09
...
...
@@ -36,6 +36,17 @@ func (db *Postgres) AutoIncrStr() string {
return
""
}
func
(
b
*
Postgres
)
Default
(
col
*
Column
)
string
{
if
col
.
Type
==
DB_Bool
{
if
col
.
Default
==
"0"
{
return
"FALSE"
}
else
{
return
"TRUE"
}
}
return
col
.
Default
}
func
(
db
*
Postgres
)
SqlType
(
c
*
Column
)
string
{
var
res
string
switch
t
:=
c
.
Type
;
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