Getting errors deleting documents from collection related with another Simplified Setup: 3 related collections
- Color (attrb: name)
- Shape (attrib: name, shapeColor[related field])
- ShapeColor (attrib: color[FK: <one way> m-to-1 on Color on delete set null], shape[FK: <two way> m-to-1 on Shap on delete cascade]
Deleting a document from Color doesn't set the related fields in ShapeColor to null but throws an Server error. Appwrite container logs
2023-12-08T15:18:22.985230878Z [Error] Timestamp: 2023-12-08T15:18:22+00:00
2023-12-08T15:18:22.985262759Z [Error] Method: DELETE
2023-12-08T15:18:22.985266599Z [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
2023-12-08T15:18:22.985270119Z [Error] Type: Utopia\Database\Exception
2023-12-08T15:18:22.985272879Z [Error] Message: Unknown PDO Type for object
2023-12-08T15:18:22.985275519Z [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php
2023-12-08T15:18:22.985278319Z [Error] Line: 1878
Conversly, deleting a document from ShapeColor throws Document not found exception
Appwrite container logs
2023-12-08T16:05:44.447421368Z [Error] Method: DELETE
2023-12-08T16:05:44.447424608Z [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
2023-12-08T16:05:44.447427528Z [Error] Type: Appwrite\Extend\Exception
2023-12-08T16:05:44.447430128Z [Error] Message: Document with the requested ID could not be found.
2023-12-08T16:05:44.447432808Z [Error] File: /usr/src/code/app/controllers/api/databases.php
2023-12-08T16:05:44.447435408Z [Error] Line: 3557
Update: There are multiple issues with deleting documents with relationships in general. Here are some relevant issues: https://github.com/appwrite/appwrite/issues/7170 https://github.com/appwrite/appwrite/issues/5850
I know relationships are experimental but I allowed myself to be temptep by the dark side (normalisation). I'll be creating relationships manually.
[Closed] Error deleting documents with relationship
Recommended threads
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- How to use Sites on selfhosted appwrite
whenever I try to create a site even with template it says 404 nginx error