Skip to content

Commit 6077197

Browse files
committed
Fix junction side
1 parent e9459e5 commit 6077197

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Database/Adapter/Mongo.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,9 @@ public function updateRelationship(
834834
throw new DatabaseException('Collection or related collection not found');
835835
}
836836

837-
$junction = $this->getNamespace() . '_' . $this->filter('_' . $collectionDoc->getSequence() . '_' . $relatedCollectionDoc->getSequence());
837+
$junction = $side === Database::RELATION_SIDE_PARENT
838+
? $this->getNamespace() . '_' . $this->filter('_' . $collectionDoc->getSequence() . '_' . $relatedCollectionDoc->getSequence())
839+
: $this->getNamespace() . '_' . $this->filter('_' . $relatedCollectionDoc->getSequence() . '_' . $collectionDoc->getSequence());
838840

839841
if (!\is_null($newKey) && $key !== $newKey) {
840842
$this->getClient()->update($junction, updates: $renameKey, multi: true);

0 commit comments

Comments
 (0)