mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 00:30:56 +00:00
Merge pull request #654 from wb14123/cmd_default
Generate default value while run ORM cmd tool
This commit is contained in:
commit
f92ce9af96
@ -144,6 +144,10 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex
|
|||||||
column += " " + "NOT NULL"
|
column += " " + "NOT NULL"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fi.initial.String() != "" {
|
||||||
|
column += " DEFAULT " + fi.initial.String()
|
||||||
|
}
|
||||||
|
|
||||||
if fi.unique {
|
if fi.unique {
|
||||||
column += " " + "UNIQUE"
|
column += " " + "UNIQUE"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user