I'm not sure if this suppose to happen, but if you select set null on document deletion it's not the behaviour I expected. I would expect when deleting the related document the attribute of the current document will be set null, but it prevent the deletion of the related document, and when you delete the current document it basically does nothing. I'm talking about one way relationship btw. I have a user collection, and a stats collection. There is a relationship in user, which point to stats as one to one one way relation. I want to be able to freely delete the documents in stats collection and it will automatically set null on the user collection's relationship attribute.
It doesn't matter that much, but it's just unclear
I don't want to loop through all documents in user collection and remove the relationship for stats, that will just not be ideal
version 1.3.7
@joeyouss would you please troubleshoot this and try to reproduce the problem?
Any follow up?
Since it's the weekend, people aren't around. You'll have to wait until maybe Monday
Alright, now it is
Any progress?
@joeyouss would you please troubleshoot this and try to reproduce the problem?
@Bill.IHCha Have you tried removing the parent document first? I'm working with relationship too and sometimes I get an error when I first remove the child element instead of the parent
I have to remove the parent to be able to delete the child, which I don't want. I want to be able to delete the child and parent attribute auto set null
Thanks for the ping, missed the first one, looking into it
@Bill.IHCha this is what I did:
- Made 2 collections one and two
- one has a relationship attribute with two (one to one and set NULL selected on deletion
- made documents in both collections
- deleted the document in two
The result for me is: in one, two shows as n/a since it is deleted
I was able to delete it successfully though
Can you confirm once the reproduction steps are okay? Because, it could be possible there are other attributes present in your collection and not in mine that are giving different answers
Adding a related issue here https://github.com/appwrite/appwrite/issues/5558 (the error is different)
I'll try again once I get on. And I'll reply ping the message
sure, I'll be waiting
Sorry for the late reply, but when I tested it in version 1.3.8 everything seems fine for now. I'll be reopening the issue once something occurs.
thank you
[CLOSED] Relationship, can't delete related document even if on deleting: set null
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Appwrite exception: user_unauthorized, t...
After refreshing the app it is working perfectly