File tree Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Columns all have the same syntax. First is the name of the column. Second is the
2424
2525* ` string `
2626* ` text `
27- * ` timestamp `
27+ * ` timestamp ` , ` time ` , ` datetime `
2828* ` integer `
2929* ` boolean `
3030
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ func (p *MySQL) buildColumn(c fizz.Column) string {
151151}
152152
153153func (p * MySQL ) colType (c fizz.Column ) string {
154- switch c .ColType {
154+ switch strings . ToLower ( c .ColType ) {
155155 case "string" :
156156 s := "255"
157157 if c .Options ["size" ] != nil {
@@ -160,7 +160,7 @@ func (p *MySQL) colType(c fizz.Column) string {
160160 return fmt .Sprintf ("VARCHAR (%s)" , s )
161161 case "uuid" :
162162 return "char(36)"
163- case "timestamp" :
163+ case "timestamp" , "time" , "datetime" :
164164 return "DATETIME"
165165 default :
166166 return c .ColType
Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ func (p *Postgres) colType(c fizz.Column) string {
144144 return fmt .Sprintf ("VARCHAR (%s)" , s )
145145 case "uuid" :
146146 return "UUID"
147+ case "time" , "datetime" :
148+ return "timestamp"
147149 default :
148150 return c .ColType
149151 }
Original file line number Diff line number Diff line change @@ -304,12 +304,12 @@ func (p *SQLite) buildColumn(c fizz.Column) string {
304304}
305305
306306func (p * SQLite ) colType (c fizz.Column ) string {
307- switch c .ColType {
307+ switch strings . ToLower ( c .ColType ) {
308308 case "uuid" :
309309 return "char(36)"
310- case "timestamp" :
310+ case "timestamp" , "time" , "datetime" :
311311 return "DATETIME"
312- case "boolean" , "DATE " :
312+ case "boolean" , "date " :
313313 return "NUMERIC"
314314 case "string" :
315315 return "TEXT"
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ func colType(s string) string {
184184 switch s {
185185 case "text" :
186186 return "string"
187- case "time" , "timestamp" :
187+ case "time" , "timestamp" , "datetime" :
188188 return "time.Time"
189189 case "nulls.Text" :
190190 return "nulls.String"
@@ -202,7 +202,7 @@ func fizzColType(s string) string {
202202 switch strings .ToLower (s ) {
203203 case "int" :
204204 return "integer"
205- case "time" :
205+ case "time" , "datetime" :
206206 return "timestamp"
207207 case "uuid.uuid" , "uuid" :
208208 return "uuid"
Original file line number Diff line number Diff line change 11package cmd
22
3- const Version = "3.21.0 "
3+ const Version = "3.21.1 "
You can’t perform that action at this time.
0 commit comments