From 8b9e5cd7d0e19d1e3f0c05d17fa7d99f1338c143 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Thu, 3 Oct 2019 06:22:49 -0700 Subject: [PATCH] ent/doc: add enum field type to docs Reviewed By: alexsn Differential Revision: D17737409 fbshipit-source-id: b12c2a3b5da7b4ca06818785d55dfeda0a2e85f1 --- doc/md/schema-fields.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/md/schema-fields.md b/doc/md/schema-fields.md index 97c713a2d..900b260f0 100755 --- a/doc/md/schema-fields.md +++ b/doc/md/schema-fields.md @@ -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).
```go @@ -86,6 +87,9 @@ func (User) Fields() []ent.Field { Optional(), field.JSON("strings", []string{}). Optional(), + field.Enum("state"). + Values("on", "off"). + Optional(), } } ```