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
- Which flutter SDK version for Self Hoste...
Hi all, Is there a good way to figure out which version of flutter SDK and Dart SDK is current for latest available self-hosted 1.8.0 ? I know new features are...
- Bug Report: Crash when trying to createR...
https://github.com/appwrite/sdk-for-android/issues/96 I think the bug is related with this one https://discord.com/channels/564160730845151244/1443887021314539...
- Dokploy docker compose
Hey guys hope y'all doing well, I was wondering if anyone could share a working 1.8.0 docker-compose that works with Dokploy I tried making it but it just does...