-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: Cannot delete entities on 1:N relationship with nullable: false #6704
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
Conversation
|
This would be a great addition! 👏 |
|
Will this PR be reviewed? I'm actually really interested in this fix personally - it would solve a lot of headaches. My project has a lot of complex graphs of children I just want to remove from the arrays and have them cascade delete, but TypeORM throws |
|
Can we ship this if it's good please? |
|
Yeah, it's a really necessary feature! Thank you for implementing it, but could you also add an option to delete the entity even if the foreign key is nullable? I think just because its nullable it shouldn't remain in a cascading relation. |
|
There ist already a merge request for this purpose #1665. |
|
@ml1nk that one was closed in 2018. |
|
@hakimio That's the problem, it was rejected and next isn't merged yet. It shouldn't be hard to reopen, but until there is new input from a maintainer it doesn't seem to make any sense to me. There is more activity recently, so there is still hope. |
|
Please merge this, it's really necessary. @imnotjames I suppose you have a lot of work to do, but you self-requested a review and then ignored it. Could you please check this and merge it? All checks passed, no conflicts. There will be conflicts if this is not merged soon, and that will delay this feature even more. Thanks in advance. |
|
Much needed feature. Please merge it ASAP. |
|
More like extremely important fix for 4 year old bug. |
|
@imnotjames Please merge this PR. It is a necessary feature. |
|
Also need this fix |
|
There is the reopened version of the orphaned row action PR ^ (#7105). I think the action needs to be configurable with something like BTW, I know the lack of interaction is frustrating but spamming comments will not change that. If you care about an issue or pull request just thumbs up it. They can be sorted by reactions, so the important issues will get to the top, don't worry. It is bad enough that the backlog is so large, if these PRs are eventually reviewed the discussion should be centered around the contents of the change, not flooded with requests for merge. |
|
closing in favor of #7105 |
Delete the entity if the relation id is not nullable instead of erroring.
Solution adapted from #2467 (comment).
closes #1761
closes #2467
closes #5645
related #1286
related #1351
related #6382