Skip to content

Commit

Permalink
Add skip relationships exist check
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Oct 16, 2024
1 parent c3740de commit 11f659b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,10 @@ protected function createDocument(Document $resource, bool $isLast): bool
$databaseInternalId = $database->getInternalId();
$collectionInternalId = $collection->getInternalId();

$this->database->createDocuments(
$this->database->skipRelationshipsExistCheck(fn () => $this->database->createDocuments(
'database_' . $databaseInternalId . '_collection_' . $collectionInternalId,
$this->documentBuffer
);
));

} finally {
$this->documentBuffer = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Sources/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ private function exportDocuments(int $batchSize): void
$queries[] = Query::cursorAfter($lastDocument);
}

$selects = ['*', '$id', '$permissions', '$updatedAt', '$createdAt']; // We want Relations flat!
$selects = ['*', '$id', '$permissions', '$updatedAt', '$createdAt']; // We want relations flat!
$manyToMany = [];

$attributes = $this->cache->get(Attribute::getName());
Expand Down

0 comments on commit 11f659b

Please sign in to comment.