From 8d68a1efe25f3b0beef748aadcd1451f018de186 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 21 Oct 2025 18:54:58 +1300 Subject: [PATCH 1/2] Fix validator --- src/Migration/Destinations/Appwrite.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index 0b89c8e..1c28911 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -733,7 +733,12 @@ protected function createIndex(Index $resource): bool /** * @var array $tableColumns */ - $tableColumns = $table->getAttribute('attributes'); + $tableColumns = $table->getAttribute('attributes', []); + + /** + * @var array $tableColumns + */ + $tableIndexes = $table->getAttribute('indexes', []); $oldColumns = \array_map( fn ($attr) => $attr->getArrayCopy(), @@ -840,9 +845,16 @@ protected function createIndex(Index $resource): bool $validator = new IndexValidator( $tableColumns, + $tableIndexes, $this->database->getAdapter()->getMaxIndexLength(), $this->database->getAdapter()->getInternalIndexesKeys(), $this->database->getAdapter()->getSupportForIndexArray(), + $this->database->getAdapter()->getSupportForSpatialIndexNull(), + $this->database->getAdapter()->getSupportForSpatialIndexOrder(), + $this->database->getAdapter()->getSupportForVectors(), + $this->database->getAdapter()->getSupportForAttributes(), + $this->database->getAdapter()->getSupportForMultipleFulltextIndexes(), + $this->database->getAdapter()->getSupportForIdenticalIndexes(), ); if (!$validator->isValid($index)) { From 39b3a5ad7157cfdbbbf135c49c837abe187324f5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 21 Oct 2025 21:11:39 +1300 Subject: [PATCH 2/2] Update src/Migration/Destinations/Appwrite.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/Migration/Destinations/Appwrite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index 1c28911..523220d 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -736,7 +736,7 @@ protected function createIndex(Index $resource): bool $tableColumns = $table->getAttribute('attributes', []); /** - * @var array $tableColumns + * @var array $tableIndexes */ $tableIndexes = $table->getAttribute('indexes', []);