Skip to content
834 changes: 771 additions & 63 deletions src/Migration/Destinations/Appwrite.php

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/Migration/Resources/Auth/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ public function __construct(
private readonly Team $team,
private readonly User $user,
private readonly array $roles = [],
private readonly bool $active = true
private readonly bool $active = true,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -38,7 +42,9 @@ public static function fromArray(array $array): self
Team::fromArray($array['team'] ?? []),
User::fromArray($array['user'] ?? []),
$array['roles'] ?? [],
$array['active'] ?? true
$array['active'] ?? true,
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -53,6 +59,8 @@ public function jsonSerialize(): array
'user' => $this->user,
'roles' => $this->roles,
'active' => $this->active,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Auth/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ public function __construct(
string $id,
private readonly string $name,
private readonly array $preferences = [],
private readonly array $members = []
private readonly array $members = [],
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -32,7 +36,9 @@ public static function fromArray(array $array): self
$array['id'],
$array['name'],
$array['preferences'] ?? [],
$array['members'] ?? []
$array['members'] ?? [],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -46,6 +52,8 @@ public function jsonSerialize(): array
'name' => $this->name,
'preferences' => $this->preferences,
'members' => $this->members,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
8 changes: 8 additions & 0 deletions src/Migration/Resources/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ public function __construct(
private readonly bool $disabled = false,
private readonly array $preferences = [],
private readonly array $targets = [],
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -57,6 +61,8 @@ public static function fromArray(array $array): self
$array['disabled'] ?? false,
$array['preferences'] ?? [],
$array['targets'] ?? [],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -78,6 +84,8 @@ public function jsonSerialize(): array
'disabled' => $this->disabled,
'preferences' => $this->preferences,
'targets' => $this->targets,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Functions/Deployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ public function __construct(
private int $start = 0,
private int $end = 0,
private string $data = '',
private readonly bool $activated = false
private readonly bool $activated = false,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -34,7 +38,9 @@ public static function fromArray(array $array): self
$array['start'] ?? 0,
$array['end'] ?? 0,
$array['data'] ?? '',
$array['activated'] ?? false
$array['activated'] ?? false,
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -52,6 +58,8 @@ public function jsonSerialize(): array
'end' => $this->end,
'data' => $this->data,
'activated' => $this->activated,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Functions/EnvVar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ public function __construct(
string $id,
private readonly Func $func,
private readonly string $key,
private readonly string $value
private readonly string $value,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -26,7 +30,9 @@ public static function fromArray(array $array): self
$array['id'],
Func::fromArray($array['func']),
$array['key'],
$array['value']
$array['value'],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -40,6 +46,8 @@ public function jsonSerialize(): array
'func' => $this->func,
'key' => $this->key,
'value' => $this->value,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Functions/Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ public function __construct(
private readonly string $commands = '',
private readonly bool $logging = true,
private readonly array $scopes = [],
private readonly string $specification = ''
private readonly string $specification = '',
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -62,7 +66,9 @@ public static function fromArray(array $array): self
$array['commands'] ?? '',
$array['logging'] ?? true,
$array['scopes'] ?? [],
$array['specification'] ?? ''
$array['specification'] ?? '',
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -86,6 +92,8 @@ public function jsonSerialize(): array
'logging' => $this->logging,
'scopes' => $this->scopes,
'specification' => $this->specification,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Sites/Deployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ public function __construct(
private int $start = 0,
private int $end = 0,
private string $data = '',
private readonly bool $activated = false
private readonly bool $activated = false,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -32,7 +36,9 @@ public static function fromArray(array $array): self
$array['start'] ?? 0,
$array['end'] ?? 0,
$array['data'] ?? '',
$array['activated'] ?? false
$array['activated'] ?? false,
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -49,6 +55,8 @@ public function jsonSerialize(): array
'end' => $this->end,
'data' => $this->data,
'activated' => $this->activated,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Sites/EnvVar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ public function __construct(
string $id,
private readonly Site $site,
private readonly string $key,
private readonly string $value
private readonly string $value,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -26,7 +30,9 @@ public static function fromArray(array $array): self
$array['id'],
Site::fromArray($array['site']),
$array['key'],
$array['value']
$array['value'],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -40,6 +46,8 @@ public function jsonSerialize(): array
'site' => $this->site,
'key' => $this->key,
'value' => $this->value,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Sites/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ public function __construct(
private readonly string $adapter = 'static',
private readonly string $fallbackFile = '',
private readonly string $specification = '',
private readonly string $activeDeployment = ''
private readonly string $activeDeployment = '',
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -62,7 +66,9 @@ public static function fromArray(array $array): self
$array['adapter'] ?? 'static',
$array['fallbackFile'] ?? '',
$array['specification'] ?? '',
$array['activeDeployment'] ?? ''
$array['activeDeployment'] ?? '',
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -86,6 +92,8 @@ public function jsonSerialize(): array
'fallbackFile' => $this->fallbackFile,
'specification' => $this->specification,
'activeDeployment' => $this->activeDeployment,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
10 changes: 9 additions & 1 deletion src/Migration/Resources/Storage/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ public function __construct(
private readonly bool $antiVirus = false,
private readonly bool $updateLimits = false,
private readonly bool $transformations = false,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->permissions = $permissions;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -57,7 +61,9 @@ public static function fromArray(array $array): self
$array['encryption'] ?? false,
$array['antiVirus'] ?? false,
$array['updateLimits'] ?? false,
$array['transformations'] ?? false
$array['transformations'] ?? false,
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -78,6 +84,8 @@ public function jsonSerialize(): array
'antiVirus' => $this->antiVirus,
'updateLimits' => $this->updateLimits,
'transformations' => $this->transformations,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
12 changes: 10 additions & 2 deletions src/Migration/Resources/Storage/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ public function __construct(
private readonly int $size = 0,
private string $data = '',
private int $start = 0,
private int $end = 0
private int $end = 0,
string $createdAt = '',
string $updatedAt = '',
) {
$this->id = $id;
$this->permissions = $permissions;
$this->createdAt = $createdAt;
$this->updatedAt = $updatedAt;
}

/**
Expand All @@ -51,7 +55,9 @@ public static function fromArray(array $array): self
$array['size'] ?? 0,
$array['data'] ?? '',
$array['start'] ?? 0,
$array['end'] ?? 0
$array['end'] ?? 0,
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
);
}

Expand All @@ -70,6 +76,8 @@ public function jsonSerialize(): array
'size' => $this->size,
'start' => $this->start,
'end' => $this->end,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
];
}

Expand Down
Loading
Loading