From d23f993a6c7e186b44ca11eded3588b5211cec13 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 21 Oct 2025 00:13:43 +1300 Subject: [PATCH] Fix validator constructor --- .../Databases/Collections/Indexes/Create.php | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index 6772b6f75e..9fb438d577 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -160,7 +160,7 @@ class Create extends Action throw new Exception($this->getParentInvalidTypeException(), "Cannot create an index for a relationship $contextType: " . $oldAttributes[$attributeIndex]['key']); } - // ensure attribute is available + // Ensure attribute is available if ($attributeStatus !== 'available') { $contextType = ucfirst($contextType); throw new Exception($this->getParentNotAvailableException(), "$contextType not available: " . $oldAttributes[$attributeIndex]['key']); @@ -190,21 +190,18 @@ class Create extends Action 'orders' => $orders, ]); - $maxIndexLength = $dbForProject->getAdapter()->getMaxIndexLength(); - $internalIndexesKeys = $dbForProject->getAdapter()->getInternalIndexesKeys(); - $supportForIndexArray = $dbForProject->getAdapter()->getSupportForIndexArray(); - $supportForSpatialAttributes = $dbForProject->getAdapter()->getSupportForSpatialAttributes(); - $supportForSpatialIndexNull = $dbForProject->getAdapter()->getSupportForSpatialIndexNull(); - $supportForSpatialIndexOrder = $dbForProject->getAdapter()->getSupportForSpatialIndexOrder(); - $validator = new IndexValidator( $collection->getAttribute('attributes'), - $maxIndexLength, - $internalIndexesKeys, - $supportForIndexArray, - $supportForSpatialAttributes, - $supportForSpatialIndexNull, - $supportForSpatialIndexOrder + $collection->getAttribute('indexes'), + $dbForProject->getAdapter()->getMaxIndexLength(), + $dbForProject->getAdapter()->getInternalIndexesKeys(), + $dbForProject->getAdapter()->getSupportForIndexArray(), + $dbForProject->getAdapter()->getSupportForSpatialIndexNull(), + $dbForProject->getAdapter()->getSupportForSpatialIndexOrder(), + $dbForProject->getAdapter()->getSupportForVectors(), + $dbForProject->getAdapter()->getSupportForAttributes(), + $dbForProject->getAdapter()->getSupportForMultipleFulltextIndexes(), + $dbForProject->getAdapter()->getSupportForIdenticalIndexes() ); if (!$validator->isValid($index)) {