M2M edge OnDelete operation is fixed to Cascade
Open
- Dominant language
- Go
- Stars
- 17.2k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I found that the OnDelete operations for M2M edges are fixed to Cascade in the source code:
https://github.com/ent/ent/blob/5718c3001b17d3efd69c0ceb101bd1de2f541ae3/entc/gen/graph.go#L691-L706
So, any attempt to set Annotations() in the schema has no effect on M2M edges.
Is this intentional? I think it would be nice to be able to block entity deletion when there are still edges referencing it.
Contributor guide
Assessment
This issue has not been assessed yet.