1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 05:01:28 +00:00

Merge pull request #654 from wb14123/cmd_default

Generate default value while run ORM cmd tool
This commit is contained in:
astaxie 2014-06-30 21:36:10 +08:00
commit f92ce9af96

View File

@ -144,6 +144,10 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex
column += " " + "NOT NULL"
}
if fi.initial.String() != "" {
column += " DEFAULT " + fi.initial.String()
}
if fi.unique {
column += " " + "UNIQUE"
}