ent / ent/ent

M2M edge OnDelete operation is fixed to Cascade

Open
#3,848 0 comments 2 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.