Skip to content

Conversation

@ml1nk
Copy link

@ml1nk ml1nk commented Sep 11, 2020

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

@filipsuk
Copy link

This would be a great addition! 👏

@imnotjames imnotjames self-requested a review October 10, 2020 12:07
@egervari
Copy link

egervari commented Oct 28, 2020

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 null as it tries to update the foreign key that is not nullable instead of deleting it.

@egervari
Copy link

egervari commented Nov 4, 2020

Can we ship this if it's good please?

@TheBlue-1
Copy link
Contributor

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.

@ml1nk
Copy link
Author

ml1nk commented Nov 9, 2020

There ist already a merge request for this purpose #1665.

@hakimio
Copy link

hakimio commented Nov 9, 2020

@ml1nk that one was closed in 2018.

@ml1nk
Copy link
Author

ml1nk commented Nov 9, 2020

@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.

@javiermrz
Copy link

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.

@tariqwebstar
Copy link

Much needed feature. Please merge it ASAP.

@hakimio
Copy link

hakimio commented Nov 18, 2020

More like extremely important fix for 4 year old bug.

@vicky-gonsalves
Copy link

vicky-gonsalves commented Nov 23, 2020

@imnotjames Please merge this PR. It is a necessary feature.

@iamnotgabriel
Copy link

Also need this fix

@nebkat nebkat mentioned this pull request Nov 24, 2020
7 tasks
@nebkat
Copy link
Contributor

nebkat commented Nov 24, 2020

There is the reopened version of the orphaned row action PR ^ (#7105).

I think the action needs to be configurable with something like orphanedRowAction rather than being based on whether the column is nullable. If the column is non-nullable, perhaps there was a mistake in deleting, so the approach of this PR doesn't seem right.


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.

@pleerock
Copy link
Member

closing in favor of #7105

@pleerock pleerock closed this Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet