Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
17a9c3c3
authored
2014-07-01 09:30:08 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ORM:revert default value
1 parent
8946f816
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
orm/cmd_utils.go
orm/models_test.go
orm/cmd_utils.go
View file @
17a9c3c
...
...
@@ -148,9 +148,9 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex
column
+=
" "
+
"NOT NULL"
}
if
fi
.
initial
.
String
()
!=
""
{
column
+=
" DEFAULT "
+
fi
.
initial
.
String
()
}
//
if fi.initial.String() != "" {
//
column += " DEFAULT " + fi.initial.String()
//
}
if
fi
.
unique
{
column
+=
" "
+
"UNIQUE"
...
...
orm/models_test.go
View file @
17a9c3c
...
...
@@ -205,7 +205,7 @@ type User struct {
Password
string
`orm:"size(100)"`
Status
int16
`orm:"column(Status)"`
IsStaff
bool
IsActive
bool
`orm:"default(
TRUE
)"`
IsActive
bool
`orm:"default(
1
)"`
Created
time
.
Time
`orm:"auto_now_add;type(date)"`
Updated
time
.
Time
`orm:"auto_now"`
Profile
*
Profile
`orm:"null;rel(one);on_delete(set_null)"`
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment