mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
schema/field: support unique bytes (#1720)
This commit is contained in:
@@ -19,8 +19,8 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) (*{{ $.Name
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID) }}
|
||||
{{- /* Do nothing, because these 2 types must be supplied by the user. */ -}}
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID $.ID.IsBytes) }}
|
||||
{{- /* Do nothing, because these 3 types must be supplied by the user. */ -}}
|
||||
{{- else }}
|
||||
{{- if $.ID.UserDefined }}
|
||||
if _node.ID == 0 {
|
||||
@@ -125,7 +125,7 @@ func ({{ $receiver }} *{{ $builder }}) Save(ctx context.Context) ([]*{{ $.Name }
|
||||
}
|
||||
mutation.{{ $.ID.BuilderField }} = &nodes[i].{{ $.ID.StructField }}
|
||||
mutation.done = true
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID) }}
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID $.ID.IsBytes) }}
|
||||
{{- /* Do nothing, because these 2 types must be supplied by the user. */ -}}
|
||||
{{- else }}
|
||||
{{- if $.ID.UserDefined }}
|
||||
|
||||
Reference in New Issue
Block a user