mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
schema/edge: allow setting immutable edges (#2876)
This commit is contained in:
@@ -127,6 +127,10 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $e := $.EdgesWithID }}
|
||||
{{- if $e.Immutable }}
|
||||
{{- /* Skip to the next one as immutable edges cannot be updated. */}}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
if {{ $mutation }}.{{ $e.MutationCleared }}() {
|
||||
{{- with extend $ "Edge" $e }}
|
||||
{{ template "dialect/sql/defedge" . }}
|
||||
|
||||
Reference in New Issue
Block a user