
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
- upgrading from 1.4.5 to 1.6.0 broke my s...
I managed to upgrade my self hosted instance from 1.4.5 to 1.6.0 and now when i try to log into the dashboard i get the error in the attached image. Also any ap...
- Is it possible to getRow with all relati...
With the new Opt-In relationship loading, is it possible to query getRow to get all attributes and relationships and possibly even cascading relationships? I tr...
- TableDB.getRow() response does not conta...
This is for Web/React sdk 20.0.0 The row was created via `TableDB.createRow(...)` and I can see it in the console with the relationships correctly set. In the c...
