mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-03 08:10:28 +00:00
update schema definitions
This commit is contained in:
parent
97a34475c8
commit
15a340baf4
2 changed files with 6 additions and 0 deletions
|
@ -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().
|
||||
|
|
|
@ -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().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue