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:
Ariel Mashraki
2022-12-04 13:15:16 +02:00
committed by GitHub
parent 3f1d7c960e
commit 381483e45c
91 changed files with 2 additions and 202 deletions

View File

@@ -159,7 +159,6 @@ func HasPrev() predicate.Node {
return predicate.Node(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PrevTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, true, PrevTable, PrevColumn),
)
sqlgraph.HasNeighbors(s, step)
@@ -187,7 +186,6 @@ func HasNext() predicate.Node {
return predicate.Node(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(NextTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, false, NextTable, NextColumn),
)
sqlgraph.HasNeighbors(s, step)