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:
@@ -13,7 +13,7 @@ type Session struct {
|
||||
|
||||
func (Session) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.UUID("id", uuid.New()).Immutable(),
|
||||
field.UUID("id", uuid.Nil).Immutable(),
|
||||
field.Time("created").Immutable(),
|
||||
field.Time("started").Nillable().Optional(), // TODO remove?
|
||||
field.String("code").MinLen(6).MaxLen(6).Immutable().Unique(),
|
||||
|
||||
Reference in New Issue
Block a user