entc/gen: set foreign-key columns non-nullable for required edges (#1703)

Note, this only applies to edges without circular references.
Fixed #1688 and #1374
This commit is contained in:
Ariel Mashraki
2022-01-23 22:23:37 +02:00
committed by GitHub
parent 1901cba436
commit 898991ac79
14 changed files with 84 additions and 55 deletions

View File

@@ -409,9 +409,6 @@ const (
// ConstName returns the constant name of a reference option. It's used by entc for printing the constant name in templates.
func (r ReferenceOption) ConstName() string {
if r == NoAction {
return ""
}
return strings.ReplaceAll(strings.Title(strings.ToLower(string(r))), " ", "")
}