Skip to content

WIP: add cascade feature to relationships - #1209

Closed
DanRibbens wants to merge 1 commit into
masterfrom
feat/cascade-update-relationships
Closed

DanRibbens wants to merge 1 commit into
masterfrom
feat/cascade-update-relationships

Conversation

@DanRibbens

@DanRibbens DanRibbens commented Oct 6, 2022 •

Copy link
Copy Markdown
Contributor

Description

It can be difficult to manage relations to other collections and in some cases it would be better to automatically update related values when a collection is deleted. I named the config property cascade but that could possibly be improved.

Remaining work:

  • Implement hook to work with nested paths

  • Test coverage for cascade relationships on globals

  • Test coverage for deeply nested relationship fields

  • Test coverage for cascade relationships inside block fields

  • Fix an issue where the order of the collections matters. Cascade is working only when relationship fields come before relationTo

  • I have read and understand the CONTRIBUTING.md document in this repository

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • Existing test suite passes locally with my changes
  • I have made corresponding changes to the documentation

@ghost

ghost commented Apr 5, 2024

Copy link
Copy Markdown

What happened to this feature? Is there a reason why this has been closed?

@DanRibbens

Copy link
Copy Markdown
Contributor Author

I had the right idea but the wrong level of abstraction when I set out to build this. It was closed after the work became too stale to keep it around. We could revisit a the pattern in general. I'd love to see more discussion on this to know if it is a widespread need or not.

@willemmulder

Copy link
Copy Markdown

Would be very much appreciated!

But a best practice workaround would be a good start. Like some sort of hook on the parent collection, but then it would need to work for batch delete as well, not just inefficient document-level hooks.

@anonymze

Copy link
Copy Markdown

+1 much needed :)

@carlosbensant

Copy link
Copy Markdown

Related: #11177

@allyoucaneattogo

Copy link
Copy Markdown

+1 very much needed, would love to retire my garbageCollector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants