From 15a340baf482ce28f813b5ebce22c6c6f6790b51 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 19 Oct 2022 20:31:21 -0800 Subject: [PATCH] update schema definitions --- backend/ent/schema/item.go | 3 +++ backend/ent/schema/location.go | 3 +++ 2 files changed, 6 insertions(+) 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().