mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
entc/gen: mark field as cleared when clearing edges (#3651)
* mark field as cleared when clearing edges * regenerate examples * run go generate in entc/integration * runn go mod tidy
This commit is contained in:
@@ -271,6 +271,7 @@ func (m *FileMutation) ResetParentID() {
|
||||
// ClearParent clears the "parent" edge to the File entity.
|
||||
func (m *FileMutation) ClearParent() {
|
||||
m.clearedparent = true
|
||||
m.clearedFields[file.FieldParentID] = struct{}{}
|
||||
}
|
||||
|
||||
// ParentCleared reports if the "parent" edge to the File entity was cleared.
|
||||
|
||||
@@ -606,6 +606,7 @@ func (m *PetMutation) ResetOwnerID() {
|
||||
// ClearOwner clears the "owner" edge to the User entity.
|
||||
func (m *PetMutation) ClearOwner() {
|
||||
m.clearedowner = true
|
||||
m.clearedFields[pet.FieldOwnerID] = struct{}{}
|
||||
}
|
||||
|
||||
// OwnerCleared reports if the "owner" edge to the User entity was cleared.
|
||||
|
||||
@@ -186,6 +186,7 @@ func (m *CardMutation) ResetOwnerID() {
|
||||
// ClearOwner clears the "owner" edge to the User entity.
|
||||
func (m *CardMutation) ClearOwner() {
|
||||
m.clearedowner = true
|
||||
m.clearedFields[card.FieldOwnerID] = struct{}{}
|
||||
}
|
||||
|
||||
// OwnerCleared reports if the "owner" edge to the User entity was cleared.
|
||||
@@ -612,6 +613,7 @@ func (m *PetMutation) ResetOwnerID() {
|
||||
// ClearBestFriend clears the "best_friend" edge to the Pet entity.
|
||||
func (m *PetMutation) ClearBestFriend() {
|
||||
m.clearedbest_friend = true
|
||||
m.clearedFields[pet.FieldBestFriendID] = struct{}{}
|
||||
}
|
||||
|
||||
// BestFriendCleared reports if the "best_friend" edge to the Pet entity was cleared.
|
||||
@@ -638,6 +640,7 @@ func (m *PetMutation) ResetBestFriend() {
|
||||
// ClearOwner clears the "owner" edge to the User entity.
|
||||
func (m *PetMutation) ClearOwner() {
|
||||
m.clearedowner = true
|
||||
m.clearedFields[pet.FieldOwnerID] = struct{}{}
|
||||
}
|
||||
|
||||
// OwnerCleared reports if the "owner" edge to the User entity was cleared.
|
||||
|
||||
@@ -255,6 +255,7 @@ func (m *NodeMutation) ResetParentID() {
|
||||
// ClearParent clears the "parent" edge to the Node entity.
|
||||
func (m *NodeMutation) ClearParent() {
|
||||
m.clearedparent = true
|
||||
m.clearedFields[node.FieldParentID] = struct{}{}
|
||||
}
|
||||
|
||||
// ParentCleared reports if the "parent" edge to the Node entity was cleared.
|
||||
|
||||
@@ -254,6 +254,7 @@ func (m *NodeMutation) ResetPrevID() {
|
||||
// ClearPrev clears the "prev" edge to the Node entity.
|
||||
func (m *NodeMutation) ClearPrev() {
|
||||
m.clearedprev = true
|
||||
m.clearedFields[node.FieldPrevID] = struct{}{}
|
||||
}
|
||||
|
||||
// PrevCleared reports if the "prev" edge to the Node entity was cleared.
|
||||
|
||||
@@ -225,6 +225,7 @@ func (m *GroupMutation) ResetName() {
|
||||
// ClearTenant clears the "tenant" edge to the Tenant entity.
|
||||
func (m *GroupMutation) ClearTenant() {
|
||||
m.clearedtenant = true
|
||||
m.clearedFields[group.FieldTenantID] = struct{}{}
|
||||
}
|
||||
|
||||
// TenantCleared reports if the "tenant" edge to the Tenant entity was cleared.
|
||||
@@ -1139,6 +1140,7 @@ func (m *UserMutation) ResetFoods() {
|
||||
// ClearTenant clears the "tenant" edge to the Tenant entity.
|
||||
func (m *UserMutation) ClearTenant() {
|
||||
m.clearedtenant = true
|
||||
m.clearedFields[user.FieldTenantID] = struct{}{}
|
||||
}
|
||||
|
||||
// TenantCleared reports if the "tenant" edge to the Tenant entity was cleared.
|
||||
|
||||
Reference in New Issue
Block a user