Skip to content

Commit

Permalink
dbal conventions: remove buggy optimization
Browse files Browse the repository at this point in the history
Having different primary keys in referencing tables does not mean
that they will be named the same in the joining table. Use proper
heuristic for PK resolution.
  • Loading branch information
hrach committed Mar 26, 2021
1 parent 4218ff6 commit 6763e43
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/Mapper/Dbal/Conventions/Conventions.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@ public function getManyHasManyStorageName(IConventions $targetConventions): stri

public function getManyHasManyStoragePrimaryKeys(IConventions $targetConventions): array
{
$one = $this->getStoragePrimaryKey()[0];
$two = $targetConventions->getStoragePrimaryKey()[0];
if ($one !== $two) {
return [$one, $two];
}

return $this->findManyHasManyPrimaryColumns(
$this->getManyHasManyStorageName($targetConventions),
$targetConventions->getStorageTable()
Expand Down

0 comments on commit 6763e43

Please sign in to comment.