2024-03-13 13:28:06 +01:00

30 lines
479 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Project holds the schema definition for the Project entity.
type Project struct {
ent.Schema
}
// Fields of the Project.
func (Project) Fields() []ent.Field {
return []ent.Field{
field.String("name").
Unique(),
}
}
// Edges of the Project.
func (Project) Edges() []ent.Edge {
return []ent.Edge{
edge.From("team", Team.Type).
Ref("project").
Unique(),
}
}