entc/gen: add EqualFold and ContainsFold to string IDs (#3382)

This commit is contained in:
Ariel Mashraki
2023-03-12 11:42:13 +02:00
committed by GitHub
parent 81eb431081
commit bbbedf53af
4 changed files with 31 additions and 1 deletions

View File

@@ -1723,7 +1723,7 @@ func (f Field) enums(lf *load.Field) ([]Enum, error) {
// Ops returns all predicate operations of the field.
func (f *Field) Ops() []Op {
ops := fieldOps(f)
if f.Name != "id" && f.cfg != nil && f.cfg.Storage.Ops != nil {
if (f.Name != "id" || !f.HasGoType()) && f.cfg != nil && f.cfg.Storage.Ops != nil {
ops = append(ops, f.cfg.Storage.Ops(f)...)
}
return ops