diff --git a/app/config/collections2.php b/app/config/collections2.php index c94fd02060..8079bdd7c8 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -136,7 +136,7 @@ $collections = [ '$id' => 'status', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, @@ -179,7 +179,7 @@ $collections = [ [ '$id' => 'signed', 'type' => Database::VAR_BOOLEAN, - 'size' => 64, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, @@ -189,7 +189,7 @@ $collections = [ [ '$id' => 'array', 'type' => Database::VAR_BOOLEAN, - 'size' => 64, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, @@ -240,8 +240,8 @@ $collections = [ 'indexes' => [ '$collection' => Database::METADATA, - '$id' => 'attributes', - 'name' => 'Attributes', + '$id' => 'indexes', + 'name' => 'Indexes', 'attributes' => [ [ '$id' => 'collectionId', @@ -269,7 +269,7 @@ $collections = [ '$id' => 'type', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, @@ -280,7 +280,7 @@ $collections = [ '$id' => 'status', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, @@ -313,7 +313,7 @@ $collections = [ '$id' => 'orders', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 255, + 'size' => 4, 'signed' => true, 'required' => false, 'default' => null, diff --git a/app/workers/database.php b/app/workers/database.php index d9fdd1263e..fd38246150 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -21,7 +21,6 @@ class DatabaseV1 extends Worker public function run(): void { Authorization::disable(); - $projectId = $this->args['projectId'] ?? ''; $type = $this->args['type'] ?? ''; $collection = $this->args['collection'] ?? []; @@ -89,7 +88,6 @@ class DatabaseV1 extends Worker if(!$dbForExternal->createAttribute($collectionId, $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) { throw new Exception('Failed to create Attribute'); } - $dbForInternal->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'available')); } catch (\Throwable $th) { Console::error($th->getMessage()); @@ -108,7 +106,6 @@ class DatabaseV1 extends Worker { $dbForInternal = $this->getInternalDB($projectId); $dbForExternal = $this->getExternalDB($projectId); - $collectionId = $collection->getId(); $key = $attribute->getAttribute('key', ''); @@ -147,7 +144,6 @@ class DatabaseV1 extends Worker if(!$dbForExternal->createIndex($collectionId, $key, $type, $attributes, $lengths, $orders)) { throw new Exception('Failed to create Index'); } - $dbForInternal->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'available')); } catch (\Throwable $th) { Console::error($th->getMessage()); diff --git a/composer.lock b/composer.lock index 60b493c217..792a6214d2 100644 --- a/composer.lock +++ b/composer.lock @@ -6287,5 +6287,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.0.0" } diff --git a/src/Appwrite/Utopia/Response/Model/Attribute.php b/src/Appwrite/Utopia/Response/Model/Attribute.php index cc5c2a7f86..2c9dbf7c22 100644 --- a/src/Appwrite/Utopia/Response/Model/Attribute.php +++ b/src/Appwrite/Utopia/Response/Model/Attribute.php @@ -26,7 +26,7 @@ class Attribute extends Model 'type' => self::TYPE_STRING, 'description' => 'Attribute status. Possible values: `available`, `processing`, `deleting`, or `failed`', 'default' => '', - 'example' => 'string', + 'example' => 'available', ]) ->addRule('required', [ 'type' => self::TYPE_BOOLEAN, diff --git a/src/Appwrite/Utopia/Response/Model/Index.php b/src/Appwrite/Utopia/Response/Model/Index.php index ed291f064e..4314971e39 100644 --- a/src/Appwrite/Utopia/Response/Model/Index.php +++ b/src/Appwrite/Utopia/Response/Model/Index.php @@ -26,7 +26,7 @@ class Index extends Model 'type' => self::TYPE_STRING, 'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, or `failed`', 'default' => '', - 'example' => 'string', + 'example' => 'available', ]) ->addRule('attributes', [ 'type' => self::TYPE_STRING,