ent
ent copied to clipboard
M2M edge OnDelete operation is fixed to Cascade
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.