Skip to content

Commit

Permalink
Revert "Merge pull request #6413 from achterin/bugfix/foreign_key_nam…
Browse files Browse the repository at this point in the history
…e_change_detection"

This reverts commit 080aab5, reversing
changes made to a5d2baf.
  • Loading branch information
dmaicher committed Jun 17, 2024
1 parent 0e3536b commit aa96737
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@ private function detectRenamedIndexes(array &$addedIndexes, array &$removedIndex
*/
public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2)
{
if (strtolower($key1->getName()) !== strtolower($key2->getName())) {
return true;
}

if (
array_map('strtolower', $key1->getUnquotedLocalColumns())
!== array_map('strtolower', $key2->getUnquotedLocalColumns())
Expand Down
9 changes: 4 additions & 5 deletions tests/Schema/AbstractComparatorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public function testCompareColumnCompareCaseInsensitive(): void
self::assertFalse($tableDiff);
}

public function testDetectIndexNameChange(): void
public function testCompareIndexBasedOnPropertiesNotName(): void
{
$tableA = new Table('foo');
$tableA->addColumn('id', Types::INTEGER);
Expand All @@ -672,7 +672,7 @@ public function testDetectIndexNameChange(): void
);
}

public function testDetectForeignKeyNameChange(): void
public function testCompareForeignKeyBasedOnPropertiesNotName(): void
{
$tableA = new Table('foo');
$tableA->addColumn('id', Types::INTEGER);
Expand All @@ -683,9 +683,8 @@ public function testDetectForeignKeyNameChange(): void
$tableB->addForeignKeyConstraint('bar', ['id'], ['id'], [], 'bar_constraint');

$tableDiff = $this->comparator->diffTable($tableA, $tableB);
self::assertNotFalse($tableDiff);
self::assertCount(1, $tableDiff->addedForeignKeys);
self::assertCount(1, $tableDiff->removedForeignKeys);

self::assertFalse($tableDiff);
}

public function testCompareForeignKeyRestrictNoActionAreTheSame(): void
Expand Down

0 comments on commit aa96737

Please sign in to comment.