mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: move node creation to sqlgraph
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user