Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 8 additions & 0 deletions src/Migration/Resources/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct(
protected string $updatedAt = '',
protected bool $enabled = true,
protected string $originalId = '',
protected string $type = '',
) {
$this->id = $id;
}
Expand All @@ -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',
);
}

Expand All @@ -59,6 +61,7 @@ public function jsonSerialize(): array
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
'enabled' => $this->enabled,
'type' => $this->type,
];
}

Expand All @@ -81,4 +84,9 @@ public function getEnabled(): bool
{
return $this->enabled;
}

public function getType(): string
{
return $this->type;
}
}
1 change: 1 addition & 0 deletions src/Migration/Sources/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ private function exportDatabases(int $batchSize): void
$database['name'],
$database['$createdAt'],
$database['$updatedAt'],
type: $database['type'] ?? 'sql'
);

$databases[] = $newDatabase;
Expand Down