#Problems with creation of Relationship Attribute

15 messages · Page 1 of 1 (latest)

pastel spear
#

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

mild agate
pastel spear
#

i'm not sure. bc. there is no error in appwrite docker log.

pastel spear
smoky wedge
#

What do you get after running this command in your appwrite installation folder?
docker compose logs appwrite

pastel spear
#

[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.

smoky wedge
#

What appwrite version you're using?

pastel spear
#

1.4.4

#

up there is my script. if u run it, u should be able to reproduce the problem.

mild agate
pastel spear
mild agate