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
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- Appwrite 1.9.0 doctor fails tho database...
So i was testing in a local environment the upgrade for 1.9.0, and after getting everything into a running state, i checked the logs that shows : ``` └── Cre...