Skip to content

Commit

Permalink
Merge pull request #4 from pauljohnston2009/master
Browse files Browse the repository at this point in the history
handle ONE_TO_ONE nullable
  • Loading branch information
dotfry authored Nov 21, 2020
2 parents 974aa5b + 4d2b479 commit e765128
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SixDreams/Bulk/MetadataLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ public static function load(ClassMetadata $metadata): Metadata
if (!\count($column)) {
continue; // looks broken...
}
// ONE_TO_ONE does not have the 'nullable' key, but creates tables that are nullable
$nullable = ($association['type'] === ClassMetadataInfo::ONE_TO_ONE || (bool) $column['nullable']);
$dmeta->addField(
$association['fieldName'],
(new JoinColumnMetadata($column['name'], '', (bool) $column['nullable']))
(new JoinColumnMetadata($column['name'], '', $nullable))
->setReferenced($column['referencedColumnName'])
);
}
Expand Down

0 comments on commit e765128

Please sign in to comment.