diff --git a/composer.lock b/composer.lock index b68e6f5a72..5b7f1bd971 100644 --- a/composer.lock +++ b/composer.lock @@ -4038,12 +4038,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "87a32dd262220cbc7d7d532d315331de19f376a2" + "reference": "93b7f4d01a2b7794374d53b7d5cf8e4b9d2509fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/87a32dd262220cbc7d7d532d315331de19f376a2", - "reference": "87a32dd262220cbc7d7d532d315331de19f376a2", + "url": "https://api.github.com/repos/utopia-php/database/zipball/93b7f4d01a2b7794374d53b7d5cf8e4b9d2509fe", + "reference": "93b7f4d01a2b7794374d53b7d5cf8e4b9d2509fe", "shasum": "" }, "require": { @@ -4981,12 +4981,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/query.git", - "reference": "efd571cd04963b91128fcdb1adb0b27c67417c32" + "reference": "d40bf14fed0a5a92146d89cc6549518a2a559c8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/query/zipball/efd571cd04963b91128fcdb1adb0b27c67417c32", - "reference": "efd571cd04963b91128fcdb1adb0b27c67417c32", + "url": "https://api.github.com/repos/utopia-php/query/zipball/d40bf14fed0a5a92146d89cc6549518a2a559c8c", + "reference": "d40bf14fed0a5a92146d89cc6549518a2a559c8c", "shasum": "" }, "require": { @@ -4994,7 +4994,7 @@ }, "require-dev": { "laravel/pint": "*", - "mongodb/mongodb": "^1.20", + "mongodb/mongodb": "^2.0", "phpstan/phpstan": "*", "phpunit/phpunit": "^12.0" }, @@ -5020,7 +5020,7 @@ "issues": "https://github.com/utopia-php/query/issues", "source": "https://github.com/utopia-php/query/tree/feat-builder" }, - "time": "2026-03-26T14:39:58+00:00" + "time": "2026-03-31T02:21:12+00:00" }, { "name": "utopia-php/queue", diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php index d3339b7d43..67b945de37 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -245,7 +245,7 @@ abstract class Action extends UtopiaAction ? UtopiaResponse::MODEL_ATTRIBUTE_INTEGER : UtopiaResponse::MODEL_COLUMN_INTEGER, - ColumnType::Float->value => $isCollections + ColumnType::Double->value => $isCollections ? UtopiaResponse::MODEL_ATTRIBUTE_FLOAT : UtopiaResponse::MODEL_COLUMN_FLOAT, @@ -553,9 +553,9 @@ abstract class Action extends UtopiaAction } if ($attribute->getAttribute('format') === APP_DATABASE_ATTRIBUTE_INT_RANGE) { - $validator = new Range($min, $max, ColumnType::Integer); + $validator = new Range($min, $max, ColumnType::Integer->value); } else { - $validator = new Range($min, $max, ColumnType::Float); + $validator = new Range($min, $max, ColumnType::Double->value); if (!is_null($default)) { $default = \floatval($default); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php index a14a93c23b..e53690ae2b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php @@ -89,14 +89,14 @@ class Create extends Action throw new Exception($this->getInvalidValueException(), 'Minimum value must be lesser than maximum value'); } - $validator = new Range($min, $max, ColumnType::Float->value); + $validator = new Range($min, $max, ColumnType::Double->value); if (!\is_null($default) && !$validator->isValid($default)) { throw new Exception($this->getInvalidValueException(), $validator->getDescription()); } $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, - 'type' => ColumnType::Float->value, + 'type' => ColumnType::Double->value, 'size' => 0, 'required' => $required, 'default' => $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php index dd791dad90..f0565e4aca 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php @@ -86,7 +86,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, authorization: $authorization, - type: ColumnType::Float->value, + type: ColumnType::Double->value, default: $default, required: $required, min: $min, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php index fe653b423f..0b8dbd38df 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php @@ -279,7 +279,9 @@ class Create extends Action array $attribute, ): array { $key = $attribute['key']; - $type = $attribute['type']; + $type = $attribute['type'] === ColumnType::Float->value + ? ColumnType::Double->value + : $attribute['type']; $size = $attribute['size'] ?? 0; $required = $attribute['required'] ?? false; $signed = $attribute['signed'] ?? true; diff --git a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php index 756293981e..1744e68299 100644 --- a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php +++ b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php @@ -159,7 +159,7 @@ class Databases extends Action // Float/int/bool values may be converted to strings during serialization if ($default !== null) { $default = match ($type) { - ColumnType::Float->value => \floatval($default), + ColumnType::Double->value => \floatval($default), ColumnType::Integer->value => \intval($default), ColumnType::Boolean->value => \boolval($default), default => $default, diff --git a/src/Appwrite/Utopia/Database/Validator/Attributes.php b/src/Appwrite/Utopia/Database/Validator/Attributes.php index 7ed7d5a56c..345e27dcad 100644 --- a/src/Appwrite/Utopia/Database/Validator/Attributes.php +++ b/src/Appwrite/Utopia/Database/Validator/Attributes.php @@ -282,7 +282,7 @@ class Attributes extends Validator if (isset($attribute['min']) || isset($attribute['max'])) { $min = $attribute['min'] ?? -\PHP_FLOAT_MAX; $max = $attribute['max'] ?? \PHP_FLOAT_MAX; - $rangeValidator = new Range($min, $max, ColumnType::Float->value); + $rangeValidator = new Range($min, $max, ColumnType::Double->value); if (!$rangeValidator->isValid((float)$attribute['default'])) { $this->message = "Default value for float attribute '" . $attribute['key'] . "' must be between $min and $max"; return false; diff --git a/src/Appwrite/Utopia/Response/Model/Collection.php b/src/Appwrite/Utopia/Response/Model/Collection.php index 255fe82b66..4ab7de8e4d 100644 --- a/src/Appwrite/Utopia/Response/Model/Collection.php +++ b/src/Appwrite/Utopia/Response/Model/Collection.php @@ -35,7 +35,7 @@ class Collection extends Model 'example' => ['read("any")'], 'array' => true ]) - ->addRule('$databaseId', [ + ->addRule('databaseId', [ 'type' => self::TYPE_STRING, 'description' => 'Database ID.', 'default' => '', diff --git a/src/Appwrite/Utopia/Response/Model/Table.php b/src/Appwrite/Utopia/Response/Model/Table.php index d5a4a4939e..20cd3ccca2 100644 --- a/src/Appwrite/Utopia/Response/Model/Table.php +++ b/src/Appwrite/Utopia/Response/Model/Table.php @@ -36,7 +36,7 @@ class Table extends Model 'example' => ['read("any")'], 'array' => true ]) - ->addRule('$databaseId', [ + ->addRule('databaseId', [ 'type' => self::TYPE_STRING, 'description' => 'Database ID.', 'default' => '',