diff --git a/src/Schema/Comparator.php b/src/Schema/Comparator.php index 804c981702b..28e7f2f73b2 100644 --- a/src/Schema/Comparator.php +++ b/src/Schema/Comparator.php @@ -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()) diff --git a/tests/Schema/AbstractComparatorTestCase.php b/tests/Schema/AbstractComparatorTestCase.php index 0470c0cdfea..a087202628f 100644 --- a/tests/Schema/AbstractComparatorTestCase.php +++ b/tests/Schema/AbstractComparatorTestCase.php @@ -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); @@ -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); @@ -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