Generate default value while run ORM cmd tool
Showing
1 changed file
with
4 additions
and
0 deletions
| ... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment