-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Taking the example below, if the IDs were custom ids ie xid, and using field.ID("user_id", "role_id") will yield into the following error
type RoleUser struct {
ent.Schema
}
func (RoleUser) Annotations() []schema.Annotation {
return []schema.Annotation{
field.ID("user_id", "role_id"),
}
}- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
2022/07/11 12:55:42 running ent codegen: execute template "create": template: create.tmpl:208:5: executing "create" at <xtemplate $tmpl .>: error calling xtemplate: template: create.tmpl:239:6: executing "dialect/sql/create_bulk" at <xtemplate $tmpl $>: error calling xtemplate: template: upsert.tmpl:338:12: executing "helper/upsertbulk" at <$.ID.UserDefined>: nil pointer evaluating *gen.Field.UserDefined
exit status 1
main.go:3: running "go": exit status 1Expected Behavior 🤔
generator not to return an error
Your Environment 🌎
| Tech | Version |
|---|---|
| Go | 1.18 |
| Ent | master |
| Database | Postgres |
| Driver | pgx |
Metadata
Metadata
Assignees
Labels
No labels