i have a script written in dart for creation of db for a project.
`` class Env { static String get APPWRITE_URL => ''; static String get APPWRITE_PROJECT_ID => 'smash'; static String get APPWRITE_DB => 'smash_db';
static String get APPWRITE_HOBBIES_COLLECTION => 'hobbies'; static String get APPWRITE_SMASH_COLLECTION => 'smashes'; static String get APPWRITE_PASS_COLLECTION => 'passes'; static String get APPWRITE_FRIENDS_COLLECTION => 'friends'; static String get APPWRITE_MEDIA_COLLECTION => 'media'; static String get APPWRITE_USERS_COLLECTION => 'users'; static String get APPWRITE_CHAT_COLLECTION => 'chat'; static String get APPWRITE_BLOCK_COLLECTION => 'blocks'; static String get APPWRITE_SUPPORT_COLLECTION => 'support'; static String get APPWRITE_REPORTS_COLLECTION => 'reports';
static String get APPWRITE_MEDIA_BUCKET => 'media'; static String get APPWRITE_DELETE_AUTH_FUNCTION => ''; static int get APPWRITE_QUERY_LIMITED => 8999999999999999999; static int get APPWRITE_DAILIES_LIMITED => 5; } ``
my problem is: that i get errors with this two: `` await AppwriteService.databases.createRelationshipAttribute( databaseId: Env.APPWRITE_DB, collectionId: Env.APPWRITE_USERS_COLLECTION, relatedCollectionId: Env.APPWRITE_SMASH_COLLECTION, key: 'smashes', type: 'oneToMany', twoWay: true, twoWayKey: 'from', onDelete: 'cascade', );
await AppwriteService.databases.createRelationshipAttribute( databaseId: Env.APPWRITE_DB, collectionId: Env.APPWRITE_USERS_COLLECTION, relatedCollectionId: Env.APPWRITE_PASS_COLLECTION, key: 'passes', type: 'oneToMany', twoWay: true, twoWayKey: 'from', onDelete: 'cascade', ); ``
i dont know why
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
what is the error?
i'm not sure. bc. there is no error in appwrite docker log.
or is there a different way to look for more details
are you 100% sure?
What do you get after running this command in your appwrite installation folder?
docker compose logs appwrite
[Error] Method: GET [Error] URL: /console/* [Error] Type: Appwrite\Extend\Exception [Error] Message: This domain is not connected to any Appwrite resource yet. Please configure custom domain or function domain to allow this request. [Error] File: /usr/src/code/app/controllers/general.php [Error] Line: 67
that was the log after docker compose up -d, and if i try to add this relationship there is no log for it.
Collection A:
- b: which is ref to Collection B
Collection B:
- a: which is a two way ref to Collection A
....
maybe this is the problem.
What appwrite version you're using?
1.4.4
up there is my script. if u run it, u should be able to reproduce the problem.
you could look at the logs from the appwrite-worker-databases container
Uhh can you search through this for the relevant attribute and only share that section?
Another option is to use the network logs from the browser dev tools to look at the list collection API call's response. The attribute should have the error message
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Seed db
hello there... is this correct way to seed appwrite