fix: check names against privateFields (#1239)

This commit is contained in:
Nathaniel Peiffer
2021-02-05 20:49:42 +11:00
committed by GitHub
parent 0f6c71d46b
commit 96ebbcd627

View File

@@ -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
}