mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-22 10:30:28 +00:00
support group edges via scaffold
This commit is contained in:
parent
9fa4da819f
commit
737007b156
4 changed files with 57 additions and 1 deletions
|
@ -49,6 +49,7 @@ func (Group) Edges() []ent.Edge {
|
|||
owned("documents", Document.Type),
|
||||
owned("invitation_tokens", GroupInvitationToken.Type),
|
||||
owned("notifiers", Notifier.Type),
|
||||
// $scaffold_edge
|
||||
}
|
||||
}
|
||||
|
||||
|
|
38
backend/internal/data/ent/schema/test.go
Executable file
38
backend/internal/data/ent/schema/test.go
Executable 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"),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue