Skip to content

Commit

Permalink
createDocument $databaseInternalId
Browse files Browse the repository at this point in the history
$collectionInternalId
  • Loading branch information
fogelito committed Jul 28, 2024
1 parent 6d3d198 commit 4b67ad5
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,35 @@ protected function createDocument(Document $resource, bool $isLast): bool
'$permissions' => $resource->getPermissions(),
], $resource->getData()));

var_dump("shmuel 1");
var_dump($isLast);

if ($isLast) {
try {
$databaseInternalId = $resource->getCollection()->getDatabase()->getInternalId();
$collectionInternalId = $resource->getCollection()->getInternalId();

//$databaseInternalId = $resource->getCollection()->getDatabase()->getInternalId();
//$collectionInternalId = $resource->getCollection()->getInternalId();

/**
* Make this use cache!
*/
$database = $this->database->getDocument(
'databases',
$resource->getCollection()->getDatabase()->getId(),
);

/**
* Make this use cache!
*/
$collection = $this->database->getDocument(
'database_' . $database->getInternalId(),
$resource->getCollection()->getId(),
);

$databaseInternalId = $database->getInternalId();
$collectionInternalId = $collection->getInternalId();
var_dump($databaseInternalId);
var_dump($collectionInternalId);
$this->database->createDocuments(
'database_' . $databaseInternalId . '_collection_' . $collectionInternalId,
$this->documentBuffer
Expand Down

0 comments on commit 4b67ad5

Please sign in to comment.