Skip to content

Commit

Permalink
distinguish between schema.Time and tag time (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
black-06 authored Apr 11, 2023
1 parent 07da3b3 commit cb2c532
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ func (dialector Dialector) DataTypeOf(field *schema.Field) string {
case schema.String:
return "text"
case schema.Time:
return "datetime"
// Distinguish between schema.Time and tag time
if val, ok := field.TagSettings["TYPE"]; ok {
return val
} else {
return "datetime"
}
case schema.Bytes:
return "blob"
}
Expand Down

0 comments on commit cb2c532

Please sign in to comment.