diff --git a/gen/templates/models/11_rel_ops.go.tpl b/gen/templates/models/11_rel_ops.go.tpl index 0ff49eb..72ad623 100644 --- a/gen/templates/models/11_rel_ops.go.tpl +++ b/gen/templates/models/11_rel_ops.go.tpl @@ -364,6 +364,8 @@ return nil } + var err error + {{if $rel.InsertEarly -}} inserted, err := {{$ftable.UpPlural}}.InsertMany(ctx, exec, related...) if err != nil {