ent/doc: add enum field type to docs

Reviewed By: alexsn

Differential Revision: D17737409

fbshipit-source-id: b12c2a3b5da7b4ca06818785d55dfeda0a2e85f1
This commit is contained in:
Ariel Mashraki
2019-10-03 06:22:49 -07:00
committed by Facebook Github Bot
parent 50637b439e
commit 8b9e5cd7d0

View File

@@ -52,6 +52,7 @@ The following types are currently supported by the framework:
- `time.Time`
- `[]byte` (only supported by SQL dialects).
- `JSON` (only supported by SQL dialects) - **experimental**.
- `Enum` (only supported by SQL dialects).
<br/>
```go
@@ -86,6 +87,9 @@ func (User) Fields() []ent.Field {
Optional(),
field.JSON("strings", []string{}).
Optional(),
field.Enum("state").
Values("on", "off").
Optional(),
}
}
```