public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*'])
{
if ($parent->getQuery()->from == $query->getQuery()->from) {
return $this->getRelationQueryForSelfRelation($query, $parent, $columns);
}
$query->select($columns);
$otherKey = $this->wrap($query->getModel()->getTable() . '.' . $this->otherKey);
return $query->where($this->getQualifiedForeignKey(), '=', new Expression($otherKey));
}