Skip to content

Commit

Permalink
Do not use null column definition
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed May 5, 2022
1 parent 7e83c92 commit 9f0ff98
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Doctrine/ORM/Tools/SchemaTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,15 +701,14 @@ private function gatherRelationJoinColumns(

$fieldMapping = $definingClass->getFieldMapping($referencedFieldName);

$columnDef = null;
$columnOptions = ['notnull' => false];

if (isset($joinColumn['columnDefinition'])) {
$columnDef = $joinColumn['columnDefinition'];
$columnOptions['columnDefinition'] = $joinColumn['columnDefinition'];
} elseif (isset($fieldMapping['columnDefinition'])) {
$columnDef = $fieldMapping['columnDefinition'];
$columnOptions['columnDefinition'] = $fieldMapping['columnDefinition'];
}

$columnOptions = ['notnull' => false, 'columnDefinition' => $columnDef];

if (isset($joinColumn['nullable'])) {
$columnOptions['notnull'] = ! $joinColumn['nullable'];
}
Expand Down

0 comments on commit 9f0ff98

Please sign in to comment.