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

@@ -57,8 +57,8 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) (*{{ $.Name
if {{ $.Receiver }}.ID == 0 {
{{- end }}
id := _spec.ID.Value.(int64)
{{ $.Receiver }}.ID = {{ if $.ID.IsString }}strconv.FormatInt(id, 10){{ else }}{{ $.ID.Type }}(id){{ end }}
{{- if and $.ID.UserDefined }}
{{ $.Receiver }}.ID = {{ $.ID.Type }}(id)
{{- if $.ID.UserDefined }}
}
{{- end }}
{{- end }}