
An error occured "Uncaught Appwrite\AppwriteException: Attribute not available: name" when creating index after creating attribute in just one script.
But if you run the create index using another script it will work.
SDK use: PHP
code example that causes the issue
<?php
require_once __DIR__ . '/vendor/autoload.php';
$client = new \Appwrite\Client();
$client->setEndpoint($_ENV['APPWRITE_ENDPOINT'])
->setProject($_ENV['APPWRITE_FUNCTION_PROJECT_ID'])
->setKey($_ENV['APPWRITE_API_KEY']);
$databaseId = $_ENV['APPWRITE_DATABASE_ID'];
$databases = new \Appwrite\Services\Databases($client);
$databases->createCollection($databaseId, 'regions', 'regions');
$databases->createStringAttribute($databaseId, 'regions', 'name', 64, true);
$databases->createStringAttribute($databaseId, 'regions', 'designation', 64, true);
$databases->createIndex($databaseId, 'regions', 'index_name', \Appwrite\Enums\IndexType::UNIQUE(), ['name']);
$databases->createIndex($databaseId, 'regions', 'index_design', \Appwrite\Enums\IndexType::UNIQUE(), ['designation']);
Recommended threads
- SDK mismatch
Hi there, The following warning is currently appearing in my console: ``` Warning: The current SDK is built for Appwrite 1.8.0. However, the current Appwrite...
- Can't read files from s3 storage directl...
I try to download the files stored by appwrite directly from my S3 provider. The bucket is not encrypted and no gzip but the files seem not to be stored there i...
- function unable to detect client ip
Hi I have hosted appwrite on self hosted server. Currently I don't have any domain. I am accessing through ip. I have created one function which should detect t...
