Save 36% for Black Friday! Learn more

New Discussion

Notifications

You’re not receiving notifications from this thread.

How do I delete orphaned children record from my model.

0
General

After a parent model gets deleted it turned out the children became orphaned and I have now added a dependent destroy on the child model to ensure it gets deleted when the parent is deleted. Will updating the foreign key to do an on_delete: :cascade delete all orphaned children I have in my database on do I have to write a migration to manually get rid of the orphaned children.

Join the discussion
Create an account Log in