[cleanup] add on constraint to the extension join to create correct
query
Merge pull request #135 from dacrome/BT-36

[cleanup] add on constraint to the extension join to create correct