mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: remove unnecessary sqlgraph.To step on HasE predicates (#3144)
Predicate that checks existence-only do not need the 'other' table
This commit is contained in:
@@ -159,7 +159,6 @@ func HasParent() predicate.Node {
|
||||
return predicate.Node(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ParentTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
@@ -187,7 +186,6 @@ func HasChildren() predicate.Node {
|
||||
return predicate.Node(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ChildrenTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
|
||||
Reference in New Issue
Block a user