Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many to one on the same collection preventing deletion #19865

Closed
br41nslug opened this issue Sep 29, 2023 · 3 comments
Closed

Many to one on the same collection preventing deletion #19865

br41nslug opened this issue Sep 29, 2023 · 3 comments
Labels

Comments

@br41nslug
Copy link
Member

Describe the Bug

When you create a many-to-one relation to the current collection the relational trigger for "on delete" will be locked to "prevent deletion". This results in being unable to delete any item in this collection that has the relation set (or is being related to if the one to many was configured too).

To Reproduce

  1. Create a recursive many-to-one relation to the same collection.
    firefox_W9A5yD0gzY

  2. set up a few records who have this relation filled.
    firefox_Ar3PvDsD6C

  3. try to delete any of these items
    firefox_VY9Jffp9lB

Directus Version

10.6.3

Hosting Strategy

Self-Hosted (Docker Image)

@SvenBudak
Copy link

Thank you for opening this issue! I'm facing exactly the same problem in my app. My feeds have comments, and those comments have replies, which are essentially also comments. As long as there are replies, a feed cannot be deleted. This means if a user in the app wants to delete their own feed, Directus throws an error. This is a significant issue, and because of it, we cannot go live at the moment. GDPR mandates that if a user wants their data to be deleted, it must be genuinely erased. Therefore, we can’t just set the status to unpublished and filter it on the frontend.

I hope this issue can be fixed without too much effort :)

@SvenBudak
Copy link

These issues sound very similar, just in case this could be helpful: #11604 #11510

@rijkvanzanten
Copy link
Member

@br41nslug The reason for that is that not all database support recursive relational constraints (notably MS SQL will error out if you try setting that).

I think we should close this in favor of #9507, which is all about implementing an app-side flow that will automatically find and help you delete related items that are preventing the deletion of the current item 🙂

@rijkvanzanten rijkvanzanten closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants