entc/gen: move node creation to sqlgraph

This commit is contained in:
Ariel Mashraki
2019-12-16 16:55:20 +02:00
parent 5e9d13be97
commit c6800a3869
71 changed files with 2524 additions and 1838 deletions

View File

@@ -16,6 +16,9 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) {
"duplicate key value violates unique constraint", // PostgreSQL.
}
)
if _, ok := err.(*sqlgraph.ConstraintError); ok {
return &ErrConstraintFailed{msg, err}, true
}
for i := range errors {
if strings.Contains(msg, errors[i]) {
return &ErrConstraintFailed{msg, err}, true