Skip to content

Commit 38a8481

Browse files
refractor adapter to adapt the updated upsert from the main
1 parent 7c40ce2 commit 38a8481

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

src/Database/Adapter/SQL.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,6 @@ public function createOrUpdateDocuments(
19501950
$bindIndex = 0;
19511951
$batchKeys = [];
19521952
$bindValues = [];
1953-
$documentIds = [];
1954-
$documentTenants = [];
19551953

19561954
foreach ($changes as $change) {
19571955
$document = $change->getNew();
@@ -1963,14 +1961,10 @@ public function createOrUpdateDocuments(
19631961

19641962
if (!empty($document->getSequence())) {
19651963
$attributes['_id'] = $document->getSequence();
1966-
} else {
1967-
$documentIds[] = $document->getId();
19681964
}
19691965

19701966
if ($this->sharedTables) {
1971-
$attributes['_tenant']
1972-
= $documentTenants[]
1973-
= $document->getTenant();
1967+
$attributes['_tenant'] = $document->getTenant();
19741968
}
19751969

19761970
\ksort($attributes);
@@ -2084,18 +2078,6 @@ public function createOrUpdateDocuments(
20842078
}
20852079
$stmtAddPermissions->execute();
20862080
}
2087-
2088-
$sequences = $this->getSequences(
2089-
$collection,
2090-
$documentIds,
2091-
$documentTenants
2092-
);
2093-
2094-
foreach ($changes as $change) {
2095-
if (isset($sequences[$change->getNew()->getId()])) {
2096-
$change->getNew()->setAttribute('$sequence', $sequences[$change->getNew()->getId()]);
2097-
}
2098-
}
20992081
} catch (PDOException $e) {
21002082
throw $this->processException($e);
21012083
}

0 commit comments

Comments
 (0)