Skip to content

Commit 65399a1

Browse files
committed
Fix relationships
1 parent abb1c92 commit 65399a1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Migration/Resources/Database/Columns/Relationship.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static function fromArray(array $array): self
7777
return new self(
7878
$array['key'],
7979
Table::fromArray($array['table'] ?? $array['collection']),
80-
relatedTable: $array['options']['relatedCollection'],
80+
relatedTable: $array['options']['relatedTable'] ?? $array['options']['relatedCollection'],
8181
relationType: $array['options']['relationType'],
8282
twoWay: $array['options']['twoWay'],
8383
twoWayKey: $array['options']['twoWayKey'],
@@ -95,7 +95,7 @@ public function getType(): string
9595

9696
public function getRelatedTable(): string
9797
{
98-
return $this->options['relatedCollection'];
98+
return $this->options['relatedTable'] ?? $this->options['relatedCollection'];
9999
}
100100

101101
public function getRelationType(): string

src/Migration/Sources/Appwrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ private function exportColumns(int $batchSize): void
923923
$col = new Relationship(
924924
$column['key'],
925925
$table,
926-
relatedTable: $column['relatedCollection'],
926+
relatedTable: $column['relatedTable'] ?? $column['relatedCollection'],
927927
relationType: $column['relationType'],
928928
twoWay: $column['twoWay'],
929929
twoWayKey: $column['twoWayKey'],

0 commit comments

Comments
 (0)