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

support for app-side cascade destroy #57

Open
u007 opened this issue Apr 13, 2018 · 3 comments
Open

support for app-side cascade destroy #57

u007 opened this issue Apr 13, 2018 · 3 comments
Labels
f: associations the associations feature in pop proposal A suggestion for a change, feature, enhancement, etc
Milestone

Comments

@u007
Copy link
Member

u007 commented Apr 13, 2018

hi,

in rails activerecord, we have this:

has_many :memberships, dependent: :destroy
has_many :memberships, dependent: :delete_all

i think best not todo delete_all as it will possibility causes hanging fruits if there are subtables in membership as it will issue direct sql statement to delete them

but when :destroy is used, then it will call model destroy method and it shall trigger sub table destroy when needed.

but one more concern is, sometimes we do not query the sub table, for example:
We query A without eagerLoad B, but when we destroy A, we wish that B as a child is also queried and destroyed in this scenario.

would love to see if anyone willing todo this?
or any guide on which code i can look for to work this out.

thank you

@sio4
Copy link
Member

sio4 commented Apr 13, 2018

Is this option not help these problem? It is not application side solution but on database.

https://github.com/gobuffalo/pop/blob/master/fizz/README.md#add-a-foreign-key

@u007
Copy link
Member Author

u007 commented Apr 13, 2018

thanks , but what we r looking for is application layer logic to handle this

@stanislas-m stanislas-m changed the title support for cascade destroy support for app-side cascade destroy Apr 16, 2018
@stanislas-m stanislas-m added enhancement proposal A suggestion for a change, feature, enhancement, etc labels Jul 27, 2018
@stanislas-m stanislas-m added proposal A suggestion for a change, feature, enhancement, etc and removed proposal A suggestion for a change, feature, enhancement, etc enhancement labels Oct 31, 2018
@jdwyant8
Copy link

jdwyant8 commented Apr 3, 2020

Hello,

I was wondering if there is any update on this?

Thanks!

@sio4 sio4 added this to the Proposal milestone Sep 20, 2022
@sio4 sio4 added the f: associations the associations feature in pop label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: associations the associations feature in pop proposal A suggestion for a change, feature, enhancement, etc
Projects
None yet
Development

No branches or pull requests

4 participants