mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-26 04:20:28 +00:00
refactor schema edges
This commit is contained in:
parent
ccd40ffcac
commit
883468e04c
12 changed files with 499 additions and 460 deletions
|
@ -2147,22 +2147,6 @@ func (c *NotifierClient) GetX(ctx context.Context, id uuid.UUID) *Notifier {
|
|||
return obj
|
||||
}
|
||||
|
||||
// QueryUser queries the user edge of a Notifier.
|
||||
func (c *NotifierClient) QueryUser(n *Notifier) *UserQuery {
|
||||
query := (&UserClient{config: c.config}).Query()
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := n.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(notifier.Table, notifier.FieldID, id),
|
||||
sqlgraph.To(user.Table, user.FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, notifier.UserTable, notifier.UserColumn),
|
||||
)
|
||||
fromV = sqlgraph.Neighbors(n.driver.Dialect(), step)
|
||||
return fromV, nil
|
||||
}
|
||||
return query
|
||||
}
|
||||
|
||||
// QueryGroup queries the group edge of a Notifier.
|
||||
func (c *NotifierClient) QueryGroup(n *Notifier) *GroupQuery {
|
||||
query := (&GroupClient{config: c.config}).Query()
|
||||
|
@ -2179,6 +2163,22 @@ func (c *NotifierClient) QueryGroup(n *Notifier) *GroupQuery {
|
|||
return query
|
||||
}
|
||||
|
||||
// QueryUser queries the user edge of a Notifier.
|
||||
func (c *NotifierClient) QueryUser(n *Notifier) *UserQuery {
|
||||
query := (&UserClient{config: c.config}).Query()
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := n.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(notifier.Table, notifier.FieldID, id),
|
||||
sqlgraph.To(user.Table, user.FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, notifier.UserTable, notifier.UserColumn),
|
||||
)
|
||||
fromV = sqlgraph.Neighbors(n.driver.Dialect(), step)
|
||||
return fromV, nil
|
||||
}
|
||||
return query
|
||||
}
|
||||
|
||||
// Hooks returns the client hooks.
|
||||
func (c *NotifierClient) Hooks() []Hook {
|
||||
return c.hooks.Notifier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue