mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
fix: check names against privateFields (#1239)
This commit is contained in:
committed by
GitHub
parent
0f6c71d46b
commit
96ebbcd627
@@ -694,6 +694,9 @@ func ValidSchemaName(name string) error {
|
||||
if _, ok := globalIdent[name]; ok {
|
||||
return fmt.Errorf("schema name conflicts with ent predeclared identifier %q", name)
|
||||
}
|
||||
if _, ok := privateField[pkg]; ok {
|
||||
return fmt.Errorf("schema name conflicts with ent builder fields %q", pkg)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user