mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: derive the id-type from the schema (#823)
if it was not provided
This commit is contained in:
@@ -17,7 +17,6 @@ import (
|
||||
|
||||
"github.com/facebook/ent/entc/gen"
|
||||
"github.com/facebook/ent/entc/load"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
)
|
||||
|
||||
// LoadGraph loads the schema package from the given schema path,
|
||||
@@ -58,9 +57,6 @@ func Generate(schemaPath string, cfg *gen.Config, options ...Option) (err error)
|
||||
// the schema.
|
||||
cfg.Target = filepath.Dir(abs)
|
||||
}
|
||||
if cfg.IDType == nil {
|
||||
cfg.IDType = &field.TypeInfo{Type: field.TypeInt}
|
||||
}
|
||||
for _, opt := range options {
|
||||
if err := opt(cfg); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user