mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: remove legacy i2a support for ids (#389)
* entc/gen: remove legacy i2a support for ids * integ: add customid tests for fk strings
This commit is contained in:
@@ -128,14 +128,6 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }}
|
||||
}
|
||||
{{- with $.Scope.Nodes }}
|
||||
for _, k := range nodes {
|
||||
{{- $id := $e.Type.ID -}}
|
||||
{{- /* Convert string-ids that are stored as int in the database */ -}}
|
||||
{{- if and (not $id.UserDefined) $id.IsString }}
|
||||
k, err := strconv.Atoi(k)
|
||||
if err != nil {
|
||||
return {{ $.Scope.Zero }}, err
|
||||
}
|
||||
{{- end }}
|
||||
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user