diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index b63509df..2520acb6 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -337,6 +337,7 @@ protected function createDatabase(Database $resource): bool '$createdAt' => $resource->getCreatedAt(), '$updatedAt' => $resource->getUpdatedAt(), 'originalId' => empty($resource->getOriginalId()) ? null : $resource->getOriginalId(), + 'type' => empty($resource->getType()) ? 'sql' : $resource->getType(), ])); $resource->setSequence($database->getSequence()); diff --git a/src/Migration/Resources/Database/Database.php b/src/Migration/Resources/Database/Database.php index 0caafeea..f644c5f5 100644 --- a/src/Migration/Resources/Database/Database.php +++ b/src/Migration/Resources/Database/Database.php @@ -22,6 +22,7 @@ public function __construct( protected string $updatedAt = '', protected bool $enabled = true, protected string $originalId = '', + protected string $type = '', ) { $this->id = $id; } @@ -45,6 +46,7 @@ public static function fromArray(array $array): self updatedAt: $array['updatedAt'] ?? '', enabled: $array['enabled'] ?? true, originalId: $array['originalId'] ?? '', + type: $array['type'] ?? 'sql', ); } @@ -59,6 +61,7 @@ public function jsonSerialize(): array 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, 'enabled' => $this->enabled, + 'type' => $this->type, ]; } @@ -81,4 +84,9 @@ public function getEnabled(): bool { return $this->enabled; } + + public function getType(): string + { + return $this->type; + } } diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index d4e6a445..ba07b941 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -725,6 +725,7 @@ private function exportDatabases(int $batchSize): void $database['name'], $database['$createdAt'], $database['$updatedAt'], + type: $database['type'] ?? 'sql' ); $databases[] = $newDatabase;