Skip to content

Commit

Permalink
Merge pull request #6445 from dmaicher/revert-6413
Browse files Browse the repository at this point in the history
Revert "Merge pull request #6413 from achterin/bugfix/foreign_key_name_change_detection"
  • Loading branch information
greg0ire authored Jun 18, 2024
2 parents 0e3536b + aa96737 commit 18ccd5b
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 18ccd5b

Please sign in to comment.