We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7f2d26 commit b0cf955Copy full SHA for b0cf955
postgres.go
@@ -189,10 +189,17 @@ func (dialector Dialector) DataTypeOf(field *schema.Field) string {
189
}
190
return "text"
191
case schema.Time:
192
+ var timeType string
193
+ // Distinguish between schema.Time and tag time
194
+ if val, ok := field.TagSettings["TYPE"]; ok {
195
+ timeType = val
196
+ } else {
197
+ timeType = "timestamptz"
198
+ }
199
if field.Precision > 0 {
- return fmt.Sprintf("timestamptz(%d)", field.Precision)
200
+ return fmt.Sprintf("%s(%d)", timeType, field.Precision)
201
- return "timestamptz"
202
+ return timeType
203
case schema.Bytes:
204
return "bytea"
205
default:
0 commit comments