#relationship

65 messages · Page 1 of 1 (latest)

cursive hollow
#

Hi,
I have a

  1. Movie Collection
  2. Cast Collection

what relation should i use here? One Way or Two Way?

open pelican
#
  • Two way
  • Many to many

As Movie can have multiple cast members
And each of the cast members can have be in multiple movies

cursive hollow
#

ohhk and when i try to create that im getting

#

failed

open pelican
#

Can you share a screenshot?

cursive hollow
open pelican
#

You should make it by id in that collection

#

In general you'll need to have a pivot table (collection) in between'

cursive hollow
#

i didnt understand

open pelican
#

One second let me check something

#

Just did it

#

and it worked

#

Maybe you had changed the attributes key values?

cursive hollow
#

now im stuck

#

not able to delete the attribute also

open pelican
#

This is cloud or self-hosted?

cursive hollow
#

self hosted

open pelican
#

What are the logs of

docker logs appwrite 
docker logs appwrite-worker-databases
#

What version of Appwrite you've?

cursive hollow
#
[Job] Received Job (65428f8e117732.23925076).
Attribute not found
[Job] (65428f8e117732.23925076) successfully run.   
cursive hollow
open pelican
#

Okay

#

This

docker logs appwrite 

Didn't show any error?

cursive hollow
#

i just deleted the collection... i will create it from scratch now

cursive hollow
open pelican
#

Don't change it though

#

I'll try

cursive hollow
#

its giving error on change of attribute key

open pelican
#

Worked

cursive hollow
open pelican
cursive hollow
#
[Error] Timestamp: 2023-11-01T17:54:09+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/attributes/:key
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Attribute with the requested ID could not be found.
[Error] File: /usr/src/code/app/controllers/api/databases.php
[Error] Line: 2339
[Error] Timestamp: 2023-11-01T17:54:09+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/attributes/:key
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Attribute with the requested ID could not be found.
[Error] File: /usr/src/code/app/controllers/api/databases.php
[Error] Line: 2339
open pelican
#

You tried to delete now?

#

Can you try on a new collection and check the logs right after?

cursive hollow
#

this is my cast collection

#

this is my movie relation

#

this is the error

[Error] Timestamp: 2023-11-01T17:55:37+00:00
[Error] Method: GET
[Error] URL: /v1/databases/:databaseId/collections/:collectionId
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Collection with the requested ID could not be found.
[Error] File: /usr/src/code/app/controllers/api/databases.php
[Error] Line: 883
open pelican
#

Okay gotcha

#

make sure the values are not the same

#

and try again

#

Make them different

cursive hollow
#

i just updated the appwrite

#

now its working fine

#

im still getting the error

open pelican
#

You've tried with 2 different names?

cursive hollow
#

what im doing is having same relation with different attribute names.. is this why its failing?

#

i can confirm its the same issue

#

appwrite-worker-databases>Logs

[Job] (654294c7df0245.50787320) successfully run.
[Job] Received Job (6542950fdf5980.82210554).
Collection _37_26 already exists
[Job] (6542950fdf5980.82210554) successfully run.
#

same problem in appwrite cloud also

if we try to create another relation with the same collection.. it fails

open pelican
#

What you've entered this time

cursive hollow
open pelican
#

Intereseting, Let's see what appwrite Steven would say

cursive hollow
cursive hollow
#

I want to create multiple two way relationships with same collections

bold knot
cursive hollow
#

Yes

cursive hollow
bold knot
cursive hollow