|
@@ -256,6 +256,12 @@ func (awflu *AddWechatFriendLogUpdate) AddSource(i int) *AddWechatFriendLogUpdat
|
|
|
return awflu
|
|
|
}
|
|
|
|
|
|
+// ClearSource clears the value of the "source" field.
|
|
|
+func (awflu *AddWechatFriendLogUpdate) ClearSource() *AddWechatFriendLogUpdate {
|
|
|
+ awflu.mutation.ClearSource()
|
|
|
+ return awflu
|
|
|
+}
|
|
|
+
|
|
|
// SetNickName sets the "nick_name" field.
|
|
|
func (awflu *AddWechatFriendLogUpdate) SetNickName(s string) *AddWechatFriendLogUpdate {
|
|
|
awflu.mutation.SetNickName(s)
|
|
@@ -270,6 +276,12 @@ func (awflu *AddWechatFriendLogUpdate) SetNillableNickName(s *string) *AddWechat
|
|
|
return awflu
|
|
|
}
|
|
|
|
|
|
+// ClearNickName clears the value of the "nick_name" field.
|
|
|
+func (awflu *AddWechatFriendLogUpdate) ClearNickName() *AddWechatFriendLogUpdate {
|
|
|
+ awflu.mutation.ClearNickName()
|
|
|
+ return awflu
|
|
|
+}
|
|
|
+
|
|
|
// SetAvatar sets the "avatar" field.
|
|
|
func (awflu *AddWechatFriendLogUpdate) SetAvatar(s string) *AddWechatFriendLogUpdate {
|
|
|
awflu.mutation.SetAvatar(s)
|
|
@@ -284,6 +296,12 @@ func (awflu *AddWechatFriendLogUpdate) SetNillableAvatar(s *string) *AddWechatFr
|
|
|
return awflu
|
|
|
}
|
|
|
|
|
|
+// ClearAvatar clears the value of the "avatar" field.
|
|
|
+func (awflu *AddWechatFriendLogUpdate) ClearAvatar() *AddWechatFriendLogUpdate {
|
|
|
+ awflu.mutation.ClearAvatar()
|
|
|
+ return awflu
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (awflu *AddWechatFriendLogUpdate) SetOrganizationID(i int64) *AddWechatFriendLogUpdate {
|
|
|
awflu.mutation.ResetOrganizationID()
|
|
@@ -305,6 +323,12 @@ func (awflu *AddWechatFriendLogUpdate) AddOrganizationID(i int64) *AddWechatFrie
|
|
|
return awflu
|
|
|
}
|
|
|
|
|
|
+// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
+func (awflu *AddWechatFriendLogUpdate) ClearOrganizationID() *AddWechatFriendLogUpdate {
|
|
|
+ awflu.mutation.ClearOrganizationID()
|
|
|
+ return awflu
|
|
|
+}
|
|
|
+
|
|
|
// Mutation returns the AddWechatFriendLogMutation object of the builder.
|
|
|
func (awflu *AddWechatFriendLogUpdate) Mutation() *AddWechatFriendLogMutation {
|
|
|
return awflu.mutation
|
|
@@ -463,18 +487,30 @@ func (awflu *AddWechatFriendLogUpdate) sqlSave(ctx context.Context) (n int, err
|
|
|
if value, ok := awflu.mutation.AddedSource(); ok {
|
|
|
_spec.AddField(addwechatfriendlog.FieldSource, field.TypeInt, value)
|
|
|
}
|
|
|
+ if awflu.mutation.SourceCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldSource, field.TypeInt)
|
|
|
+ }
|
|
|
if value, ok := awflu.mutation.NickName(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldNickName, field.TypeString, value)
|
|
|
}
|
|
|
+ if awflu.mutation.NickNameCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldNickName, field.TypeString)
|
|
|
+ }
|
|
|
if value, ok := awflu.mutation.Avatar(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldAvatar, field.TypeString, value)
|
|
|
}
|
|
|
+ if awflu.mutation.AvatarCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldAvatar, field.TypeString)
|
|
|
+ }
|
|
|
if value, ok := awflu.mutation.OrganizationID(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64, value)
|
|
|
}
|
|
|
if value, ok := awflu.mutation.AddedOrganizationID(); ok {
|
|
|
_spec.AddField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64, value)
|
|
|
}
|
|
|
+ if awflu.mutation.OrganizationIDCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64)
|
|
|
+ }
|
|
|
if n, err = sqlgraph.UpdateNodes(ctx, awflu.driver, _spec); err != nil {
|
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
|
err = &NotFoundError{addwechatfriendlog.Label}
|
|
@@ -724,6 +760,12 @@ func (awfluo *AddWechatFriendLogUpdateOne) AddSource(i int) *AddWechatFriendLogU
|
|
|
return awfluo
|
|
|
}
|
|
|
|
|
|
+// ClearSource clears the value of the "source" field.
|
|
|
+func (awfluo *AddWechatFriendLogUpdateOne) ClearSource() *AddWechatFriendLogUpdateOne {
|
|
|
+ awfluo.mutation.ClearSource()
|
|
|
+ return awfluo
|
|
|
+}
|
|
|
+
|
|
|
// SetNickName sets the "nick_name" field.
|
|
|
func (awfluo *AddWechatFriendLogUpdateOne) SetNickName(s string) *AddWechatFriendLogUpdateOne {
|
|
|
awfluo.mutation.SetNickName(s)
|
|
@@ -738,6 +780,12 @@ func (awfluo *AddWechatFriendLogUpdateOne) SetNillableNickName(s *string) *AddWe
|
|
|
return awfluo
|
|
|
}
|
|
|
|
|
|
+// ClearNickName clears the value of the "nick_name" field.
|
|
|
+func (awfluo *AddWechatFriendLogUpdateOne) ClearNickName() *AddWechatFriendLogUpdateOne {
|
|
|
+ awfluo.mutation.ClearNickName()
|
|
|
+ return awfluo
|
|
|
+}
|
|
|
+
|
|
|
// SetAvatar sets the "avatar" field.
|
|
|
func (awfluo *AddWechatFriendLogUpdateOne) SetAvatar(s string) *AddWechatFriendLogUpdateOne {
|
|
|
awfluo.mutation.SetAvatar(s)
|
|
@@ -752,6 +800,12 @@ func (awfluo *AddWechatFriendLogUpdateOne) SetNillableAvatar(s *string) *AddWech
|
|
|
return awfluo
|
|
|
}
|
|
|
|
|
|
+// ClearAvatar clears the value of the "avatar" field.
|
|
|
+func (awfluo *AddWechatFriendLogUpdateOne) ClearAvatar() *AddWechatFriendLogUpdateOne {
|
|
|
+ awfluo.mutation.ClearAvatar()
|
|
|
+ return awfluo
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (awfluo *AddWechatFriendLogUpdateOne) SetOrganizationID(i int64) *AddWechatFriendLogUpdateOne {
|
|
|
awfluo.mutation.ResetOrganizationID()
|
|
@@ -773,6 +827,12 @@ func (awfluo *AddWechatFriendLogUpdateOne) AddOrganizationID(i int64) *AddWechat
|
|
|
return awfluo
|
|
|
}
|
|
|
|
|
|
+// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
+func (awfluo *AddWechatFriendLogUpdateOne) ClearOrganizationID() *AddWechatFriendLogUpdateOne {
|
|
|
+ awfluo.mutation.ClearOrganizationID()
|
|
|
+ return awfluo
|
|
|
+}
|
|
|
+
|
|
|
// Mutation returns the AddWechatFriendLogMutation object of the builder.
|
|
|
func (awfluo *AddWechatFriendLogUpdateOne) Mutation() *AddWechatFriendLogMutation {
|
|
|
return awfluo.mutation
|
|
@@ -961,18 +1021,30 @@ func (awfluo *AddWechatFriendLogUpdateOne) sqlSave(ctx context.Context) (_node *
|
|
|
if value, ok := awfluo.mutation.AddedSource(); ok {
|
|
|
_spec.AddField(addwechatfriendlog.FieldSource, field.TypeInt, value)
|
|
|
}
|
|
|
+ if awfluo.mutation.SourceCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldSource, field.TypeInt)
|
|
|
+ }
|
|
|
if value, ok := awfluo.mutation.NickName(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldNickName, field.TypeString, value)
|
|
|
}
|
|
|
+ if awfluo.mutation.NickNameCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldNickName, field.TypeString)
|
|
|
+ }
|
|
|
if value, ok := awfluo.mutation.Avatar(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldAvatar, field.TypeString, value)
|
|
|
}
|
|
|
+ if awfluo.mutation.AvatarCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldAvatar, field.TypeString)
|
|
|
+ }
|
|
|
if value, ok := awfluo.mutation.OrganizationID(); ok {
|
|
|
_spec.SetField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64, value)
|
|
|
}
|
|
|
if value, ok := awfluo.mutation.AddedOrganizationID(); ok {
|
|
|
_spec.AddField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64, value)
|
|
|
}
|
|
|
+ if awfluo.mutation.OrganizationIDCleared() {
|
|
|
+ _spec.ClearField(addwechatfriendlog.FieldOrganizationID, field.TypeInt64)
|
|
|
+ }
|
|
|
_node = &AddWechatFriendLog{config: awfluo.config}
|
|
|
_spec.Assign = _node.assignValues
|
|
|
_spec.ScanValues = _node.scanValues
|