Back

Error deleting document with relationship

  • 0
  • Databases
  • Flutter
Faisal7
4 Feb, 2024, 22:05

i have two colections. Tags and Posts which post has tages attribute referenced with tags table and has tow way one to one relationship. i get Document cannot be deleted because it is referenced by another document error.

by the way i have updated the On deleting a document from restrict to cascade.

what am i doing wrong can anybody help me please?

TL;DR
Error: When trying to delete a document, receiving an error message stating that the document cannot be deleted because it is referenced by another document. Solution: The issue may be due to the relationship between the Tags and Posts collections. Check if the relationship is set correctly, and ensure that the on-deleting behavior is set to cascade instead of restrict. This will allow the deletion of the document even if it is referenced by another document.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more