dialect/sql/schema: accept convert from string2enum and enum2stirng (#587)

This commit is contained in:
Ariel Mashraki
2020-07-05 22:22:50 +03:00
committed by GitHub
parent 1a8d98f507
commit cedeef653a
17 changed files with 598 additions and 5 deletions

View File

@@ -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.
}
}