diff --git a/backend/ent/schema/item.go b/backend/ent/schema/item.go index b9fcd9a..25531d0 100644 --- a/backend/ent/schema/item.go +++ b/backend/ent/schema/item.go @@ -94,6 +94,9 @@ func (Item) Fields() []ent.Field { // Edges of the Item. func (Item) Edges() []ent.Edge { return []ent.Edge{ + edge.To("children", Item.Type). + From("parent"). + Unique(), edge.From("group", Group.Type). Ref("items"). Required(). diff --git a/backend/ent/schema/location.go b/backend/ent/schema/location.go index 74e0abb..e8f2237 100644 --- a/backend/ent/schema/location.go +++ b/backend/ent/schema/location.go @@ -27,6 +27,9 @@ func (Location) Fields() []ent.Field { // Edges of the Location. func (Location) Edges() []ent.Edge { return []ent.Edge{ + edge.To("children", Location.Type). + From("parent"). + Unique(), edge.From("group", Group.Type). Ref("locations"). Unique().