mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
ent/gen: set currect storage-key for indexes
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/66 Reviewed By: alexsn Differential Revision: D17779042 fbshipit-source-id: 12be885b20f91eb611a41e361650f7a66747fab0
This commit is contained in:
committed by
Facebook Github Bot
parent
b64330e475
commit
766940563f
@@ -17,7 +17,7 @@ func ({{ $receiver }} *{{ $.Name }}) FromResponse(res *gremlin.Response) error {
|
||||
var {{ $scan }} struct {
|
||||
ID {{ $.ID.Type }} `json:"id,omitempty"`
|
||||
{{ range $_, $f := $.Fields }}
|
||||
{{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nillable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"`
|
||||
{{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nillable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.StorageKey }},omitempty"`
|
||||
{{ end }}
|
||||
}
|
||||
if err := vmap.Decode(&{{ $scan }}); err != nil {
|
||||
@@ -45,7 +45,7 @@ func ({{ $receiver }} *{{ $slice }}) FromResponse(res *gremlin.Response) error {
|
||||
var {{ $scan }} []struct {
|
||||
ID {{ $.ID.Type }} `json:"id,omitempty"`
|
||||
{{ range $_, $f := $.Fields }}
|
||||
{{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nillable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"`
|
||||
{{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nillable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.StorageKey }},omitempty"`
|
||||
{{ end }}
|
||||
}
|
||||
if err := vmap.Decode(&{{ $scan }}); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user