mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: skip Table() predicate and warn about reserved schema name (Client) (#2486)
* entc/gen: do no generate `Table()` predicate and warn the user in case of reserved schema name like `Client`. * doc/md: document reserved schema name * doc/md: revert reserved schema name as this was already working * doc/md: rephrase
This commit is contained in:
@@ -41,7 +41,7 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} {
|
||||
{{/* JSON cannot be compared using "=" and Enum has a type defined with the field name */}}
|
||||
{{ $hasP := not (or $f.IsJSON $f.IsEnum) }}
|
||||
{{ $comparable := or $f.ConvertedToBasic $f.Type.Valuer }}
|
||||
{{ $undeclared := (and (ne $func "Label") (ne $func "Hooks") (ne $func "Policy")) }}
|
||||
{{ $undeclared := (and (ne $func "Label") (ne $func "Hooks") (ne $func "Policy") (ne $func "Table")) }}
|
||||
{{- if and $hasP $comparable $undeclared }}
|
||||
{{ $arg := "v" }}
|
||||
// {{ $func }} applies equality check predicate on the {{ quote $f.Name }} field. It's identical to {{ $func }}EQ.
|
||||
|
||||
Reference in New Issue
Block a user