support group edges via scaffold

This commit is contained in:
Hayden 2023-03-05 21:56:53 -09:00
parent 9fa4da819f
commit 737007b156
No known key found for this signature in database
GPG key ID: 17CF79474E257545
4 changed files with 57 additions and 1 deletions

View file

@ -49,6 +49,7 @@ func (Group) Edges() []ent.Edge {
owned("documents", Document.Type),
owned("invitation_tokens", GroupInvitationToken.Type),
owned("notifiers", Notifier.Type),
// $scaffold_edge
}
}

View file

@ -0,0 +1,38 @@
package schema
import (
"entgo.io/ent"
"github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins"
)
type Test struct {
ent.Schema
}
func (Test) Mixin() []ent.Mixin {
return []ent.Mixin{
mixins.BaseMixin{},
GroupMixin{ref: "tests"},
}
}
// Fields of the Test.
func (Test) Fields() []ent.Field {
return []ent.Field{
// field.String("name").
}
}
// Edges of the Test.
func (Test) Edges() []ent.Edge {
return []ent.Edge{
// edge.From("group", Group.Type).
}
}
func (Test) Indexes() []ent.Index {
return []ent.Index{
// index.Fields("token"),
}
}