Skip to content

Commit 8adb126

Browse files
Fix postgres shared tables aswell
1 parent d478079 commit 8adb126

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Database/Adapter/Postgres.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,9 @@ public function createDocuments(string $collection, array $documents, int $batch
10461046
$attributeKeys = array_merge($attributeKeys, array_keys($attributes));
10471047
}
10481048
$attributeKeys = array_unique($attributeKeys);
1049+
if ($this->sharedTables) {
1050+
$attributeKeys[] = '_tenant';
1051+
}
10491052

10501053
$batches = \array_chunk($documents, max(1, $batchSize));
10511054
$internalIds = [];
@@ -1073,6 +1076,7 @@ public function createDocuments(string $collection, array $documents, int $batch
10731076
if (!empty($document->getInternalId())) {
10741077
$internalIds[$document->getId()] = true;
10751078
$attributes['_id'] = $document->getInternalId();
1079+
$attributeKeys[] = '_id';
10761080
}
10771081

10781082
if ($this->sharedTables) {

0 commit comments

Comments
 (0)