Commit f92ce9af authored by astaxie's avatar astaxie

Merge pull request #654 from wb14123/cmd_default

Generate default value while run ORM cmd tool
parents c83c17d9 7b7a9567
...@@ -144,6 +144,10 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex ...@@ -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"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment