1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 19:00:54 +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" column += " " + "NOT NULL"
} }
if fi.initial.String() != "" {
column += " DEFAULT " + fi.initial.String()
}
if fi.unique { if fi.unique {
column += " " + "UNIQUE" column += " " + "UNIQUE"
} }