portfolio/ent/schema/team.go

27 lines
418 B
Go
Raw Normal View History

2024-02-14 13:08:27 +01:00
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Team holds the schema definition for the Team entity.
type Team struct {
ent.Schema
}
// Fields of the Team.
func (Team) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
}
// Edges of the Team.
func (Team) Edges() []ent.Edge {
return []ent.Edge{
edge.To("projects", Project.Type),
}
}