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:
@@ -493,7 +493,6 @@ func HasOwner() predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(OwnerTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
|
||||
@@ -470,7 +470,6 @@ func HasCards() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(CardsTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, CardsTable, CardsColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
@@ -498,7 +497,6 @@ func HasFriends() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(FriendsTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
@@ -526,7 +524,6 @@ func HasBestFriend() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(BestFriendTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2O, false, BestFriendTable, BestFriendColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
|
||||
Reference in New Issue
Block a user