Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #6413 from achterin/bugfix/foreign_key_name_change_detection" #6445

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading