Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
314a447d
Commit
314a447d
authored
Apr 12, 2016
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1879 from miraclesu/feature/orm_text
orm: use `text` as postgres default type
parents
9c400778
51858169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
cmd_utils.go
orm/cmd_utils.go
+5
-1
models_info_f.go
orm/models_info_f.go
+2
-0
No files found.
orm/cmd_utils.go
View file @
314a447d
...
...
@@ -52,7 +52,11 @@ checkColumn:
case
TypeBooleanField
:
col
=
T
[
"bool"
]
case
TypeCharField
:
col
=
fmt
.
Sprintf
(
T
[
"string"
],
fieldSize
)
if
al
.
Driver
==
DRPostgres
&&
fi
.
toText
{
col
=
T
[
"string-text"
]
}
else
{
col
=
fmt
.
Sprintf
(
T
[
"string"
],
fieldSize
)
}
case
TypeTextField
:
col
=
T
[
"string-text"
]
case
TypeTimeField
:
...
...
orm/models_info_f.go
View file @
314a447d
...
...
@@ -119,6 +119,7 @@ type fieldInfo struct {
colDefault
bool
initial
StrTo
size
int
toText
bool
autoNow
bool
autoNowAdd
bool
rel
bool
...
...
@@ -359,6 +360,7 @@ checkType:
}
}
else
{
fi
.
size
=
255
fi
.
toText
=
true
}
case
TypeTextField
:
fi
.
index
=
false
...
...
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