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
e4988b71
Commit
e4988b71
authored
Oct 17, 2014
by
supar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add property colDefault to fieldInfo object, set its true if there is
orm configuration default `orm:"default(1)"`
parent
9c07332c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
models_info_f.go
orm/models_info_f.go
+6
-0
No files found.
orm/models_info_f.go
View file @
e4988b71
...
@@ -116,6 +116,7 @@ type fieldInfo struct {
...
@@ -116,6 +116,7 @@ type fieldInfo struct {
null
bool
null
bool
index
bool
index
bool
unique
bool
unique
bool
colDefault
bool
initial
StrTo
initial
StrTo
size
int
size
int
auto_now
bool
auto_now
bool
...
@@ -280,6 +281,11 @@ checkType:
...
@@ -280,6 +281,11 @@ checkType:
fi
.
pk
=
attrs
[
"pk"
]
fi
.
pk
=
attrs
[
"pk"
]
fi
.
unique
=
attrs
[
"unique"
]
fi
.
unique
=
attrs
[
"unique"
]
// Mark object property if there is attribute "default" in the orm configuration
if
_
,
ok
:=
tags
[
"default"
];
ok
{
fi
.
colDefault
=
true
}
switch
fieldType
{
switch
fieldType
{
case
RelManyToMany
,
RelReverseMany
,
RelReverseOne
:
case
RelManyToMany
,
RelReverseMany
,
RelReverseOne
:
fi
.
null
=
false
fi
.
null
=
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