Skip to content

Commit dfa6c78

Browse files
Add 'type' property to Database resource and update Appwrite source
1 parent fc25d50 commit dfa6c78

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/Migration/Destinations/Appwrite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ protected function createDatabase(Database $resource): bool
337337
'$createdAt' => $resource->getCreatedAt(),
338338
'$updatedAt' => $resource->getUpdatedAt(),
339339
'originalId' => empty($resource->getOriginalId()) ? null : $resource->getOriginalId(),
340+
'type' => empty($resource->getType()) ? null : $resource->getType(),
340341
]));
341342

342343
$resource->setSequence($database->getSequence());

src/Migration/Resources/Database/Database.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function __construct(
2222
protected string $updatedAt = '',
2323
protected bool $enabled = true,
2424
protected string $originalId = '',
25+
protected string $type = '',
2526
) {
2627
$this->id = $id;
2728
}
@@ -45,6 +46,7 @@ public static function fromArray(array $array): self
4546
updatedAt: $array['updatedAt'] ?? '',
4647
enabled: $array['enabled'] ?? true,
4748
originalId: $array['originalId'] ?? '',
49+
type: $array['type'] ?? '',
4850
);
4951
}
5052

@@ -59,6 +61,7 @@ public function jsonSerialize(): array
5961
'createdAt' => $this->createdAt,
6062
'updatedAt' => $this->updatedAt,
6163
'enabled' => $this->enabled,
64+
'type' => $this->type,
6265
];
6366
}
6467

@@ -81,4 +84,9 @@ public function getEnabled(): bool
8184
{
8285
return $this->enabled;
8386
}
87+
88+
public function getType(): string
89+
{
90+
return $this->type;
91+
}
8492
}

src/Migration/Sources/Appwrite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ private function exportDatabases(int $batchSize): void
725725
$database['name'],
726726
$database['$createdAt'],
727727
$database['$updatedAt'],
728+
type:$database['type']
728729
);
729730

730731
$databases[] = $newDatabase;

0 commit comments

Comments
 (0)