Skip to content

Commit

Permalink
mariadb check if internalId is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Aug 27, 2023
1 parent 41802d4 commit 54dac44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Database/Adapter/MariaDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@ public function createDocuments(string $collection, array $documents, int $batch
$attributes['_createdAt'] = $document->getCreatedAt();
$attributes['_updatedAt'] = $document->getUpdatedAt();
$attributes['_permissions'] = \json_encode($document->getPermissions());
$attributes['_id'] = $document->getInternalId();
if(!empty($document->getInternalId())) {
$attributes['_id'] = $document->getInternalId();
}

$columns = [];
foreach (\array_keys($attributes) as $key => $attribute) {
Expand Down

0 comments on commit 54dac44

Please sign in to comment.