From 951211641928c0fdf15fc119d3ab2964221a4a62 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Tue, 27 Sep 2022 00:42:38 +0700 Subject: [PATCH] entc: codegen Signed-off-by: Giau. Tran Minh --- entc/integration/edgefield/ent/rental_update.go | 2 ++ entc/integration/edgefield/ent/user_update.go | 2 ++ entc/integration/edgeschema/ent/friendship_update.go | 2 ++ examples/privacytenant/ent/group_update.go | 2 ++ examples/privacytenant/ent/user_update.go | 2 ++ 5 files changed, 10 insertions(+) diff --git a/entc/integration/edgefield/ent/rental_update.go b/entc/integration/edgefield/ent/rental_update.go index 2c9a692403..b02d8ded27 100644 --- a/entc/integration/edgefield/ent/rental_update.go +++ b/entc/integration/edgefield/ent/rental_update.go @@ -147,6 +147,7 @@ func (ru *RentalUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: rental.FieldDate, }) } + if n, err = sqlgraph.UpdateNodes(ctx, ru.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{rental.Label} @@ -311,6 +312,7 @@ func (ruo *RentalUpdateOne) sqlSave(ctx context.Context) (_node *Rental, err err Column: rental.FieldDate, }) } + _node = &Rental{config: ruo.config} _spec.Assign = _node.assignValues _spec.ScanValues = _node.scanValues diff --git a/entc/integration/edgefield/ent/user_update.go b/entc/integration/edgefield/ent/user_update.go index 0fa4f8de51..8c986ad353 100644 --- a/entc/integration/edgefield/ent/user_update.go +++ b/entc/integration/edgefield/ent/user_update.go @@ -392,6 +392,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if uu.mutation.ChildrenCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, @@ -1064,6 +1065,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if uuo.mutation.ChildrenCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, diff --git a/entc/integration/edgeschema/ent/friendship_update.go b/entc/integration/edgeschema/ent/friendship_update.go index 885dd518ea..1fc3fe24d2 100644 --- a/entc/integration/edgeschema/ent/friendship_update.go +++ b/entc/integration/edgeschema/ent/friendship_update.go @@ -182,6 +182,7 @@ func (fu *FriendshipUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: friendship.FieldCreatedAt, }) } + if n, err = sqlgraph.UpdateNodes(ctx, fu.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{friendship.Label} @@ -381,6 +382,7 @@ func (fuo *FriendshipUpdateOne) sqlSave(ctx context.Context) (_node *Friendship, Column: friendship.FieldCreatedAt, }) } + _node = &Friendship{config: fuo.config} _spec.Assign = _node.assignValues _spec.ScanValues = _node.scanValues diff --git a/examples/privacytenant/ent/group_update.go b/examples/privacytenant/ent/group_update.go index 16489a1c7d..00961cd8af 100644 --- a/examples/privacytenant/ent/group_update.go +++ b/examples/privacytenant/ent/group_update.go @@ -180,6 +180,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: group.FieldName, }) } + if gu.mutation.UsersCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2M, @@ -431,6 +432,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error Column: group.FieldName, }) } + if guo.mutation.UsersCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2M, diff --git a/examples/privacytenant/ent/user_update.go b/examples/privacytenant/ent/user_update.go index 2fe0fe6b4a..cf5ab72560 100644 --- a/examples/privacytenant/ent/user_update.go +++ b/examples/privacytenant/ent/user_update.go @@ -205,6 +205,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: user.FieldFoods, }) } + if uu.mutation.GroupsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2M, @@ -481,6 +482,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) Column: user.FieldFoods, }) } + if uuo.mutation.GroupsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2M,