mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sqlgraph: test and fix M2M neighbors check
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/190 Reviewed By: alexsn Differential Revision: D18680440 fbshipit-source-id: b2dce0ee3e0a898fab901c4287c6c1c1844e51d6
This commit is contained in:
committed by
Facebook Github Bot
parent
0344904a4e
commit
038dc2899a
@@ -148,9 +148,9 @@ func HasNeighbors(q *Selector, s *Step) {
|
||||
builder := Dialect(q.dialect)
|
||||
switch r := s.Edge.Rel; {
|
||||
case r == M2M:
|
||||
pk1 := s.Edge.Columns[1]
|
||||
pk1 := s.Edge.Columns[0]
|
||||
if s.Edge.Inverse {
|
||||
pk1 = s.Edge.Columns[0]
|
||||
pk1 = s.Edge.Columns[1]
|
||||
}
|
||||
from := q.Table()
|
||||
join := builder.Table(s.Edge.Table)
|
||||
|
||||
Reference in New Issue
Block a user