update schema definitions

This commit is contained in:
Hayden 2022-10-19 20:31:21 -08:00
parent 97a34475c8
commit 15a340baf4
2 changed files with 6 additions and 0 deletions

View file

@ -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().

View file

@ -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().