Skip to content

Commit a497301

Browse files
committed
distinguish between schema.Time and tag time
fix go-gorm/gorm#6033
1 parent 7f4b498 commit a497301

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sqlite.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ func (dialector Dialector) DataTypeOf(field *schema.Field) string {
178178
case schema.String:
179179
return "text"
180180
case schema.Time:
181-
return "datetime"
181+
// Distinguish between schema.Time and tag time
182+
if val, ok := field.TagSettings["TYPE"]; ok {
183+
return val
184+
} else {
185+
return "datetime"
186+
}
182187
case schema.Bytes:
183188
return "blob"
184189
}

0 commit comments

Comments
 (0)