mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-11 21:39:16 +00:00
chores/general-cleanup-release-prep (#31)
* do ent generation * update edges * fix redirect
This commit is contained in:
parent
8a43fc953d
commit
1ca430af21
47 changed files with 785 additions and 765 deletions
|
@ -98,6 +98,8 @@ func (Item) Edges() []ent.Edge {
|
|||
Ref("items").
|
||||
Required().
|
||||
Unique(),
|
||||
edge.From("label", Label.Type).
|
||||
Ref("items"),
|
||||
edge.From("location", Location.Type).
|
||||
Ref("items").
|
||||
Unique(),
|
||||
|
@ -105,11 +107,6 @@ func (Item) Edges() []ent.Edge {
|
|||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
edge.From("label", Label.Type).
|
||||
Ref("items").
|
||||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
edge.To("attachments", Attachment.Type).
|
||||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
|
|
|
@ -2,7 +2,6 @@ package schema
|
|||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/hay-kot/homebox/backend/ent/schema/mixins"
|
||||
|
@ -36,9 +35,6 @@ func (Label) Edges() []ent.Edge {
|
|||
Ref("labels").
|
||||
Required().
|
||||
Unique(),
|
||||
edge.To("items", Item.Type).
|
||||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
edge.To("items", Item.Type),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,9 @@ func (User) Edges() []ent.Edge {
|
|||
Ref("users").
|
||||
Required().
|
||||
Unique(),
|
||||
edge.To("auth_tokens", AuthTokens.Type).Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
edge.To("auth_tokens", AuthTokens.Type).
|
||||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue