Did you make any changes to the collection or attributes after creating this relationship?
I may have deleted it and recreated (on an empty collection)
That could be the problem
Ideally this attribute should have been deleted too
Is there a work-around to delete the document - in this current state?
Is deleting the collection and recreating it from scratch the only solution?
What's the current value for the attribute?
I didn't get you. what do you mean by value?
What's the result of getDocument?
empty list []
You might have to go directly into the database to delete it then
I'm not sure if this is an issue from the way I'm configuring or may be it should be documented as to how the relationships can be cleaned up. The other table gives this error:
[Error] Message: Unknown column 'object' in 'field list'
What I mean is - I'm not sure if I should be reporting this as a bug?
@Drake ^^
This issue persists even when both the collections are created from scratch and the relationships added.
what's yoour code and what are your collections (as JSON)?
Table 1
{
"$id": "654c9bc06a5b9d7a7c8d",
"name": "feed_activities",
"enabled": true,
"documentSecurity": false,
"attributes": [
{
"key": "name",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 64,
"default": null
},
{
"key": "result",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 524288,
"default": null
},
{
"key": "notify",
"type": "boolean",
"status": "available",
"error": "",
"required": false,
"array": false,
"default": null
},
{
"key": "actor",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9aa06a5b9e7a7c8c",
"relationType": "manyToMany",
"twoWay": true,
"twoWayKey": "activities",
"onDelete": "setNull",
"side": "parent"
},
{
"key": "object",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "65570c6420b88746ea8d",
"relationType": "oneToMany",
"twoWay": true,
"twoWayKey": "activities",
"onDelete": "cascade",
"side": "child"
}
],
"indexes": []
}
Table 2
{
"$id": "65570c6420b88746ea8d",
"$permissions": [
"read(\"users\")"
],
"name": "feed_objects",
"enabled": true,
"documentSecurity": true,
"attributes": [
{
"key": "type",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 16,
"default": "Object"
},
{
"key": "name",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 32,
"default": null
},
{
"key": "actor",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9aa06a5b9e7a7c8c",
"relationType": "oneToMany",
"twoWay": false,
"twoWayKey": "65570c6420b88746ea8d",
"onDelete": "setNull",
"side": "parent"
},
{
"key": "activities",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9bc06a5b9d7a7c8d",
"relationType": "oneToMany",
"twoWay": true,
"twoWayKey": "object",
"onDelete": "cascade",
"side": "parent"
}
],
"indexes": [
]
}
I'm not using any code - just using appwrite web console to add/remove. Add works fine. But delete throws errors.
What are you doing exactly?
I have 2 tables that have this 2 way relationships - Object has activities and activity belongs to an object.
When I create an object, I also add zero or more activities. When I try to delete the obejct it throws the error I have mentioned in the summary of this discussion.
I was able to successfully add and remove (link/unlink) documents as well as delete documents without any error 🧐
could the problem be with the 3rd relationship you have?
I'll try removing the 3rd relationship and check.
Recommended threads
- Which flutter SDK version for Self Hoste...
Hi all, Is there a good way to figure out which version of flutter SDK and Dart SDK is current for latest available self-hosted 1.8.0 ? I know new features are...
- Bug Report: Crash when trying to createR...
https://github.com/appwrite/sdk-for-android/issues/96 I think the bug is related with this one https://discord.com/channels/564160730845151244/1443887021314539...
- Dokploy docker compose
Hey guys hope y'all doing well, I was wondering if anyone could share a working 1.8.0 docker-compose that works with Dokploy I tried making it but it just does...