7b7a9567 by Bin Wang

Generate default value while run ORM cmd tool

1 parent 469f283b
...@@ -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
144 column += " " + "NOT NULL" 144 column += " " + "NOT NULL"
145 } 145 }
146 146
147 if fi.initial.String() != "" {
148 column += " DEFAULT " + fi.initial.String()
149 }
150
147 if fi.unique { 151 if fi.unique {
148 column += " " + "UNIQUE" 152 column += " " + "UNIQUE"
149 } 153 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!