Use uuid.Nil instead of uuid.New() in ent schema initializers

It is used just to carry the sql.Scanner and sql.Valuer interface.
This commit is contained in:
Vojtěch Káně
2021-02-15 17:15:59 +01:00
parent 20bb2aa6bb
commit cc74774950
7 changed files with 9 additions and 11 deletions

View File

@@ -13,15 +13,14 @@ type Choice struct {
func (Choice) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.New()).Immutable(),
field.UUID("id", uuid.Nil).Immutable(),
field.Text("title").MinLen(1).MaxLen(256),
field.Bool("correct"),
}
}
func (Choice) Indexes() []ent.Index {
return []ent.Index{
}
return []ent.Index{}
}
func (Choice) Edges() []ent.Edge {