Skip to content

Commit 511dacf

Browse files
Fix shared tables
1 parent 2148821 commit 511dacf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Database/Adapter/MariaDB.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ public function createDocuments(string $collection, array $documents, int $batch
988988
}
989989
$attributeKeys = array_unique($attributeKeys);
990990

991+
if ($this->sharedTables) {
992+
$attributeKeys[] = '_tenant';
993+
}
994+
991995
$batches = \array_chunk($documents, \max(1, $batchSize));
992996
$documentIds = \array_map(fn ($document) => $document->getId(), $documents);
993997

@@ -1013,6 +1017,7 @@ public function createDocuments(string $collection, array $documents, int $batch
10131017
if (!empty($document->getInternalId())) {
10141018
$internalIds[$document->getId()] = true;
10151019
$attributes['_id'] = $document->getInternalId();
1020+
$attributeKeys[] = '_id';
10161021
}
10171022

10181023
if ($this->sharedTables) {

0 commit comments

Comments
 (0)