portfolio/ent/schema/user.go
darius 08fc61d643 User model update
Docker orm update
2024-02-14 12:39:10 +01:00

27 lines
427 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name").
Default("John doe"),
field.Enum("role").
Values("admin", "user", "visitor"),
}
}
// Edges of the User.
func (User) Edges() []ent.Edge {
return nil
}