Skip to content

Commit cf347c7

Browse files
committed
DEBUG Merge branch 'fix_unique_for_fk' into feature/join-foreign-id-field-not-id
2 parents d3933ca + a66d7f8 commit cf347c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Schema/Migrator.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -492,14 +492,13 @@ public function createForeignKey($relation): void
492492

493493
if (!$this->isIndexExists([$foreignField], true)) {
494494
if ($foreignField->nullable && !$foreignField->required && $platform instanceof SQLServerPlatform) {
495-
// workaround https://github.com/doctrine/dbal/issues/5507
496495
$foreignFieldForIndex = clone $foreignField;
497496
$foreignFieldForIndex->nullable = false;
498497
} else {
499498
$foreignFieldForIndex = $foreignField;
500499
}
501500

502-
$this->createIndex([$foreignField], true);
501+
$this->createIndex([$foreignFieldForIndex], true);
503502
}
504503

505504
$foreignKey = new ForeignKeyConstraint(

0 commit comments

Comments
 (0)