Skip to content

Commit aa96737

Browse files
committed
Revert "Merge pull request #6413 from achterin/bugfix/foreign_key_name_change_detection"
This reverts commit 080aab5, reversing changes made to a5d2baf.
1 parent 0e3536b commit aa96737

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/Schema/Comparator.php

-4
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,6 @@ private function detectRenamedIndexes(array &$addedIndexes, array &$removedIndex
555555
*/
556556
public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2)
557557
{
558-
if (strtolower($key1->getName()) !== strtolower($key2->getName())) {
559-
return true;
560-
}
561-
562558
if (
563559
array_map('strtolower', $key1->getUnquotedLocalColumns())
564560
!== array_map('strtolower', $key2->getUnquotedLocalColumns())

tests/Schema/AbstractComparatorTestCase.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ public function testCompareColumnCompareCaseInsensitive(): void
652652
self::assertFalse($tableDiff);
653653
}
654654

655-
public function testDetectIndexNameChange(): void
655+
public function testCompareIndexBasedOnPropertiesNotName(): void
656656
{
657657
$tableA = new Table('foo');
658658
$tableA->addColumn('id', Types::INTEGER);
@@ -672,7 +672,7 @@ public function testDetectIndexNameChange(): void
672672
);
673673
}
674674

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

685685
$tableDiff = $this->comparator->diffTable($tableA, $tableB);
686-
self::assertNotFalse($tableDiff);
687-
self::assertCount(1, $tableDiff->addedForeignKeys);
688-
self::assertCount(1, $tableDiff->removedForeignKeys);
686+
687+
self::assertFalse($tableDiff);
689688
}
690689

691690
public function testCompareForeignKeyRestrictNoActionAreTheSame(): void

0 commit comments

Comments
 (0)