mirror of
https://github.com/ent/ent.git
synced 2026-05-05 00:50:54 +03:00
dialect/sql/schema: use the postgres column type if exists (#466)
This commit is contained in:
@@ -220,7 +220,7 @@ func (d *Postgres) scanColumn(c *Column, rows *sql.Rows) error {
|
||||
c.Size = maxCharSize + 1
|
||||
case "character", "character varying":
|
||||
c.Type = field.TypeString
|
||||
case "timestamp with time zone":
|
||||
case "date", "time", "timestamp", "timestamp with time zone":
|
||||
c.Type = field.TypeTime
|
||||
case "bytea":
|
||||
c.Type = field.TypeBytes
|
||||
@@ -284,7 +284,7 @@ func (d *Postgres) cType(c *Column) (t string) {
|
||||
t = "text"
|
||||
}
|
||||
case field.TypeTime:
|
||||
t = "timestamp with time zone"
|
||||
t = c.scanTypeOr("timestamp with time zone")
|
||||
case field.TypeEnum:
|
||||
// Currently, the support for enums is weak (application level only.
|
||||
// like SQLite). Dialect needs to create and maintain its enum type.
|
||||
|
||||
Reference in New Issue
Block a user