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:
Ariel Mashraki
2020-03-16 18:19:30 +02:00
committed by GitHub
parent 15cbc5c223
commit 65f96b3593
110 changed files with 1911 additions and 1900 deletions

View File

@@ -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 }}