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
1 changed files with 4 additions and 0 deletions

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