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
- Error upgrading from 1.8.1 to 1.9.0
DO Self-hosted server failed to upgrade with this error "Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.42". U...
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...