1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 22:40:55 +00:00

Generate default value while run ORM cmd tool

This commit is contained in:
Bin Wang 2014-06-22 10:52:14 +08:00
parent 469f283b68
commit 7b7a95677a

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"
} }