Skip to content

Commit

Permalink
Merge pull request #6416 from doctrine/3.8.x
Browse files Browse the repository at this point in the history
Merge 3.8.x up into 3.9.x
  • Loading branch information
greg0ire committed Jun 1, 2024
2 parents 7d67d25 + 080aab5 commit f375b44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Driver/OCI8/Middleware/InitializeSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function connect(
'ALTER SESSION SET'
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIME_FORMAT = 'HH24:MI:SS'"
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS TZH:TZM'"
. " NLS_NUMERIC_CHARACTERS = '.,'",
Expand Down
4 changes: 4 additions & 0 deletions src/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ 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: 5 additions & 4 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 testCompareIndexBasedOnPropertiesNotName(): void
public function testDetectIndexNameChange(): void
{
$tableA = new Table('foo');
$tableA->addColumn('id', Types::INTEGER);
Expand All @@ -672,7 +672,7 @@ public function testCompareIndexBasedOnPropertiesNotName(): void
);
}

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

$tableDiff = $this->comparator->diffTable($tableA, $tableB);

self::assertFalse($tableDiff);
self::assertNotFalse($tableDiff);
self::assertCount(1, $tableDiff->addedForeignKeys);
self::assertCount(1, $tableDiff->removedForeignKeys);
}

public function testCompareForeignKeyRestrictNoActionAreTheSame(): void
Expand Down

0 comments on commit f375b44

Please sign in to comment.