diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index 0b89c8e..523220d 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 $tableIndexes + */ + $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)) {