mirror of
https://github.com/ent/ent.git
synced 2026-05-02 23:50:54 +03:00
dialect/sql/schema: postgres support for uuid type
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/178 Reviewed By: alexsn Differential Revision: D18615561 fbshipit-source-id: 8244189186bf35d78cfdb991ee4f8cecd6411cee
This commit is contained in:
committed by
Facebook Github Bot
parent
33d08673cf
commit
db7b05ad04
@@ -220,6 +220,8 @@ func (d *Postgres) scanColumn(c *Column, rows *sql.Rows) error {
|
||||
c.Type = field.TypeBytes
|
||||
case "jsonb":
|
||||
c.Type = field.TypeJSON
|
||||
case "uuid":
|
||||
c.Type = field.TypeUUID
|
||||
}
|
||||
switch {
|
||||
case !defaults.Valid:
|
||||
@@ -265,6 +267,8 @@ func (d *Postgres) cType(c *Column) (t string) {
|
||||
t = "bytea"
|
||||
case field.TypeJSON:
|
||||
t = "jsonb"
|
||||
case field.TypeUUID:
|
||||
t = "uuid"
|
||||
case field.TypeString:
|
||||
t = "varchar"
|
||||
if c.Size > maxCharSize {
|
||||
|
||||
Reference in New Issue
Block a user