mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: accept convert from string2enum and enum2stirng (#587)
This commit is contained in:
@@ -50,6 +50,10 @@ func (User) Fields() []ent.Field {
|
||||
field.Enum("state").
|
||||
Optional().
|
||||
Values("logged_in", "logged_out", "online"),
|
||||
// convert string to enum.
|
||||
field.Enum("status").
|
||||
Optional().
|
||||
Values("done", "pending"),
|
||||
// deleting the `address` column.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user