diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index d132273b5d..3166189be5 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2500,8 +2500,11 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') 'orders' => $orders, ]); - $validator = new IndexValidator($dbForProject->getAdapter()->getMaxIndexLength()); - if (!$validator->isValid($collection->setAttribute('indexes', $index, Document::SET_TYPE_APPEND))) { + $validator = new IndexValidator( + $collection->getAttribute('attributes'), + $dbForProject->getAdapter()->getMaxIndexLength() + ); + if (!$validator->isValid($index)) { throw new Exception(Exception::INDEX_INVALID, $validator->getDescription()); } diff --git a/composer.json b/composer.json index 0ffbfe6200..44ed5e4925 100644 --- a/composer.json +++ b/composer.json @@ -43,13 +43,13 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.13.*", "appwrite/php-clamav": "2.0.*", - "utopia-php/abuse": "0.31.*", + "utopia-php/abuse": "0.32.*", "utopia-php/analytics": "0.10.*", - "utopia-php/audit": "0.33.*", + "utopia-php/audit": "0.34.*", "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.43.*", + "utopia-php/database": "dev-feat-global-timeouts as 0.44.1", "utopia-php/domains": "0.3.*", "utopia-php/dsn": "0.1.*", "utopia-php/framework": "0.31.0", diff --git a/composer.lock b/composer.lock index e45e4b3d86..ca208ebf2f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a0624bf1df70e602233efa5916aa6ce", + "content-hash": "72caaa81d73965a0375e3765b378ba4a", "packages": [ { "name": "adhocore/jwt", @@ -1681,23 +1681,23 @@ }, { "name": "utopia-php/abuse", - "version": "0.31.1", + "version": "0.32.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "b2ad372d1070f55f9545cb811b6ed2d40094e6dd" + "reference": "9717ffb2d7711f3fd621bb6df3edf5724c08ea78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/b2ad372d1070f55f9545cb811b6ed2d40094e6dd", - "reference": "b2ad372d1070f55f9545cb811b6ed2d40094e6dd", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/9717ffb2d7711f3fd621bb6df3edf5724c08ea78", + "reference": "9717ffb2d7711f3fd621bb6df3edf5724c08ea78", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.43.*" + "utopia-php/database": "0.44.*" }, "require-dev": { "laravel/pint": "1.5.*", @@ -1724,9 +1724,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.31.1" + "source": "https://github.com/utopia-php/abuse/tree/0.32.0" }, - "time": "2023-08-29T11:07:46+00:00" + "time": "2023-10-18T07:28:55+00:00" }, { "name": "utopia-php/analytics", @@ -1776,21 +1776,21 @@ }, { "name": "utopia-php/audit", - "version": "0.33.1", + "version": "0.34.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "c117e8e9ce4e3e1b369e8b5b55b2d6ab3138eadd" + "reference": "cf34cc3f9f20da4e574a9be4517e1a11025a858f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/c117e8e9ce4e3e1b369e8b5b55b2d6ab3138eadd", - "reference": "c117e8e9ce4e3e1b369e8b5b55b2d6ab3138eadd", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/cf34cc3f9f20da4e574a9be4517e1a11025a858f", + "reference": "cf34cc3f9f20da4e574a9be4517e1a11025a858f", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/database": "0.43.*" + "utopia-php/database": "0.44.*" }, "require-dev": { "laravel/pint": "1.5.*", @@ -1817,9 +1817,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.33.1" + "source": "https://github.com/utopia-php/audit/tree/0.34.0" }, - "time": "2023-08-29T11:07:40+00:00" + "time": "2023-10-18T07:43:25+00:00" }, { "name": "utopia-php/cache", @@ -1972,16 +1972,16 @@ }, { "name": "utopia-php/database", - "version": "0.43.5", + "version": "dev-feat-global-timeouts", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "5f7b05189cfbcc0506090498c580c5765375a00a" + "reference": "1ceaf65ecc6e6a982cd12266d1fd08435994b563" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/5f7b05189cfbcc0506090498c580c5765375a00a", - "reference": "5f7b05189cfbcc0506090498c580c5765375a00a", + "url": "https://api.github.com/repos/utopia-php/database/zipball/1ceaf65ecc6e6a982cd12266d1fd08435994b563", + "reference": "1ceaf65ecc6e6a982cd12266d1fd08435994b563", "shasum": "" }, "require": { @@ -2022,9 +2022,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.43.5" + "source": "https://github.com/utopia-php/database/tree/feat-global-timeouts" }, - "time": "2023-10-06T06:49:47+00:00" + "time": "2023-10-19T01:10:04+00:00" }, { "name": "utopia-php/domains", @@ -5864,9 +5864,18 @@ "time": "2023-08-28T11:09:02+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-feat-global-timeouts", + "alias": "0.44.1", + "alias_normalized": "0.44.1.0" + } + ], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": {