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

@@ -194,7 +194,6 @@ func HasSpouse() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(SpouseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn),
)
sqlgraph.HasNeighbors(s, step)
@@ -222,7 +221,6 @@ func HasFollowers() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(FollowersTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
@@ -250,7 +248,6 @@ func HasFollowing() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(FollowingTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)