1
0
api/ent/user_update.go
2024-06-08 01:02:27 +09:00

3795 lines
100 KiB
Go

// Code generated by ent, DO NOT EDIT.
package ent
import (
"api/ent/card"
"api/ent/ma"
"api/ent/predicate"
"api/ent/sev"
"api/ent/ue"
"api/ent/user"
"context"
"errors"
"fmt"
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
)
// UserUpdate is the builder for updating User entities.
type UserUpdate struct {
config
hooks []Hook
mutation *UserMutation
}
// Where appends a list predicates to the UserUpdate builder.
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {
uu.mutation.Where(ps...)
return uu
}
// SetDid sets the "did" field.
func (uu *UserUpdate) SetDid(s string) *UserUpdate {
uu.mutation.SetDid(s)
return uu
}
// SetNillableDid sets the "did" field if the given value is not nil.
func (uu *UserUpdate) SetNillableDid(s *string) *UserUpdate {
if s != nil {
uu.SetDid(*s)
}
return uu
}
// ClearDid clears the value of the "did" field.
func (uu *UserUpdate) ClearDid() *UserUpdate {
uu.mutation.ClearDid()
return uu
}
// SetMember sets the "member" field.
func (uu *UserUpdate) SetMember(b bool) *UserUpdate {
uu.mutation.SetMember(b)
return uu
}
// SetNillableMember sets the "member" field if the given value is not nil.
func (uu *UserUpdate) SetNillableMember(b *bool) *UserUpdate {
if b != nil {
uu.SetMember(*b)
}
return uu
}
// ClearMember clears the value of the "member" field.
func (uu *UserUpdate) ClearMember() *UserUpdate {
uu.mutation.ClearMember()
return uu
}
// SetBook sets the "book" field.
func (uu *UserUpdate) SetBook(b bool) *UserUpdate {
uu.mutation.SetBook(b)
return uu
}
// SetNillableBook sets the "book" field if the given value is not nil.
func (uu *UserUpdate) SetNillableBook(b *bool) *UserUpdate {
if b != nil {
uu.SetBook(*b)
}
return uu
}
// ClearBook clears the value of the "book" field.
func (uu *UserUpdate) ClearBook() *UserUpdate {
uu.mutation.ClearBook()
return uu
}
// SetManga sets the "manga" field.
func (uu *UserUpdate) SetManga(b bool) *UserUpdate {
uu.mutation.SetManga(b)
return uu
}
// SetNillableManga sets the "manga" field if the given value is not nil.
func (uu *UserUpdate) SetNillableManga(b *bool) *UserUpdate {
if b != nil {
uu.SetManga(*b)
}
return uu
}
// ClearManga clears the value of the "manga" field.
func (uu *UserUpdate) ClearManga() *UserUpdate {
uu.mutation.ClearManga()
return uu
}
// SetBadge sets the "badge" field.
func (uu *UserUpdate) SetBadge(b bool) *UserUpdate {
uu.mutation.SetBadge(b)
return uu
}
// SetNillableBadge sets the "badge" field if the given value is not nil.
func (uu *UserUpdate) SetNillableBadge(b *bool) *UserUpdate {
if b != nil {
uu.SetBadge(*b)
}
return uu
}
// ClearBadge clears the value of the "badge" field.
func (uu *UserUpdate) ClearBadge() *UserUpdate {
uu.mutation.ClearBadge()
return uu
}
// SetBsky sets the "bsky" field.
func (uu *UserUpdate) SetBsky(b bool) *UserUpdate {
uu.mutation.SetBsky(b)
return uu
}
// SetNillableBsky sets the "bsky" field if the given value is not nil.
func (uu *UserUpdate) SetNillableBsky(b *bool) *UserUpdate {
if b != nil {
uu.SetBsky(*b)
}
return uu
}
// ClearBsky clears the value of the "bsky" field.
func (uu *UserUpdate) ClearBsky() *UserUpdate {
uu.mutation.ClearBsky()
return uu
}
// SetMastodon sets the "mastodon" field.
func (uu *UserUpdate) SetMastodon(b bool) *UserUpdate {
uu.mutation.SetMastodon(b)
return uu
}
// SetNillableMastodon sets the "mastodon" field if the given value is not nil.
func (uu *UserUpdate) SetNillableMastodon(b *bool) *UserUpdate {
if b != nil {
uu.SetMastodon(*b)
}
return uu
}
// ClearMastodon clears the value of the "mastodon" field.
func (uu *UserUpdate) ClearMastodon() *UserUpdate {
uu.mutation.ClearMastodon()
return uu
}
// SetDelete sets the "delete" field.
func (uu *UserUpdate) SetDelete(b bool) *UserUpdate {
uu.mutation.SetDelete(b)
return uu
}
// SetNillableDelete sets the "delete" field if the given value is not nil.
func (uu *UserUpdate) SetNillableDelete(b *bool) *UserUpdate {
if b != nil {
uu.SetDelete(*b)
}
return uu
}
// ClearDelete clears the value of the "delete" field.
func (uu *UserUpdate) ClearDelete() *UserUpdate {
uu.mutation.ClearDelete()
return uu
}
// SetHandle sets the "handle" field.
func (uu *UserUpdate) SetHandle(b bool) *UserUpdate {
uu.mutation.SetHandle(b)
return uu
}
// SetNillableHandle sets the "handle" field if the given value is not nil.
func (uu *UserUpdate) SetNillableHandle(b *bool) *UserUpdate {
if b != nil {
uu.SetHandle(*b)
}
return uu
}
// ClearHandle clears the value of the "handle" field.
func (uu *UserUpdate) ClearHandle() *UserUpdate {
uu.mutation.ClearHandle()
return uu
}
// SetToken sets the "token" field.
func (uu *UserUpdate) SetToken(s string) *UserUpdate {
uu.mutation.SetToken(s)
return uu
}
// SetNillableToken sets the "token" field if the given value is not nil.
func (uu *UserUpdate) SetNillableToken(s *string) *UserUpdate {
if s != nil {
uu.SetToken(*s)
}
return uu
}
// ClearToken clears the value of the "token" field.
func (uu *UserUpdate) ClearToken() *UserUpdate {
uu.mutation.ClearToken()
return uu
}
// SetUpdatedAt sets the "updated_at" field.
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate {
uu.mutation.SetUpdatedAt(t)
return uu
}
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableUpdatedAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetUpdatedAt(*t)
}
return uu
}
// ClearUpdatedAt clears the value of the "updated_at" field.
func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate {
uu.mutation.ClearUpdatedAt()
return uu
}
// SetRaidAt sets the "raid_at" field.
func (uu *UserUpdate) SetRaidAt(t time.Time) *UserUpdate {
uu.mutation.SetRaidAt(t)
return uu
}
// SetNillableRaidAt sets the "raid_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableRaidAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetRaidAt(*t)
}
return uu
}
// ClearRaidAt clears the value of the "raid_at" field.
func (uu *UserUpdate) ClearRaidAt() *UserUpdate {
uu.mutation.ClearRaidAt()
return uu
}
// SetServerAt sets the "server_at" field.
func (uu *UserUpdate) SetServerAt(t time.Time) *UserUpdate {
uu.mutation.SetServerAt(t)
return uu
}
// SetNillableServerAt sets the "server_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableServerAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetServerAt(*t)
}
return uu
}
// ClearServerAt clears the value of the "server_at" field.
func (uu *UserUpdate) ClearServerAt() *UserUpdate {
uu.mutation.ClearServerAt()
return uu
}
// SetEggAt sets the "egg_at" field.
func (uu *UserUpdate) SetEggAt(t time.Time) *UserUpdate {
uu.mutation.SetEggAt(t)
return uu
}
// SetNillableEggAt sets the "egg_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableEggAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetEggAt(*t)
}
return uu
}
// ClearEggAt clears the value of the "egg_at" field.
func (uu *UserUpdate) ClearEggAt() *UserUpdate {
uu.mutation.ClearEggAt()
return uu
}
// SetLuck sets the "luck" field.
func (uu *UserUpdate) SetLuck(i int) *UserUpdate {
uu.mutation.ResetLuck()
uu.mutation.SetLuck(i)
return uu
}
// SetNillableLuck sets the "luck" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLuck(i *int) *UserUpdate {
if i != nil {
uu.SetLuck(*i)
}
return uu
}
// AddLuck adds i to the "luck" field.
func (uu *UserUpdate) AddLuck(i int) *UserUpdate {
uu.mutation.AddLuck(i)
return uu
}
// ClearLuck clears the value of the "luck" field.
func (uu *UserUpdate) ClearLuck() *UserUpdate {
uu.mutation.ClearLuck()
return uu
}
// SetLuckAt sets the "luck_at" field.
func (uu *UserUpdate) SetLuckAt(t time.Time) *UserUpdate {
uu.mutation.SetLuckAt(t)
return uu
}
// SetNillableLuckAt sets the "luck_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLuckAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetLuckAt(*t)
}
return uu
}
// ClearLuckAt clears the value of the "luck_at" field.
func (uu *UserUpdate) ClearLuckAt() *UserUpdate {
uu.mutation.ClearLuckAt()
return uu
}
// SetLike sets the "like" field.
func (uu *UserUpdate) SetLike(i int) *UserUpdate {
uu.mutation.ResetLike()
uu.mutation.SetLike(i)
return uu
}
// SetNillableLike sets the "like" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLike(i *int) *UserUpdate {
if i != nil {
uu.SetLike(*i)
}
return uu
}
// AddLike adds i to the "like" field.
func (uu *UserUpdate) AddLike(i int) *UserUpdate {
uu.mutation.AddLike(i)
return uu
}
// ClearLike clears the value of the "like" field.
func (uu *UserUpdate) ClearLike() *UserUpdate {
uu.mutation.ClearLike()
return uu
}
// SetLikeRank sets the "like_rank" field.
func (uu *UserUpdate) SetLikeRank(i int) *UserUpdate {
uu.mutation.ResetLikeRank()
uu.mutation.SetLikeRank(i)
return uu
}
// SetNillableLikeRank sets the "like_rank" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLikeRank(i *int) *UserUpdate {
if i != nil {
uu.SetLikeRank(*i)
}
return uu
}
// AddLikeRank adds i to the "like_rank" field.
func (uu *UserUpdate) AddLikeRank(i int) *UserUpdate {
uu.mutation.AddLikeRank(i)
return uu
}
// ClearLikeRank clears the value of the "like_rank" field.
func (uu *UserUpdate) ClearLikeRank() *UserUpdate {
uu.mutation.ClearLikeRank()
return uu
}
// SetLikeAt sets the "like_at" field.
func (uu *UserUpdate) SetLikeAt(t time.Time) *UserUpdate {
uu.mutation.SetLikeAt(t)
return uu
}
// SetNillableLikeAt sets the "like_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLikeAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetLikeAt(*t)
}
return uu
}
// ClearLikeAt clears the value of the "like_at" field.
func (uu *UserUpdate) ClearLikeAt() *UserUpdate {
uu.mutation.ClearLikeAt()
return uu
}
// SetFav sets the "fav" field.
func (uu *UserUpdate) SetFav(i int) *UserUpdate {
uu.mutation.ResetFav()
uu.mutation.SetFav(i)
return uu
}
// SetNillableFav sets the "fav" field if the given value is not nil.
func (uu *UserUpdate) SetNillableFav(i *int) *UserUpdate {
if i != nil {
uu.SetFav(*i)
}
return uu
}
// AddFav adds i to the "fav" field.
func (uu *UserUpdate) AddFav(i int) *UserUpdate {
uu.mutation.AddFav(i)
return uu
}
// ClearFav clears the value of the "fav" field.
func (uu *UserUpdate) ClearFav() *UserUpdate {
uu.mutation.ClearFav()
return uu
}
// SetTen sets the "ten" field.
func (uu *UserUpdate) SetTen(b bool) *UserUpdate {
uu.mutation.SetTen(b)
return uu
}
// SetNillableTen sets the "ten" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTen(b *bool) *UserUpdate {
if b != nil {
uu.SetTen(*b)
}
return uu
}
// ClearTen clears the value of the "ten" field.
func (uu *UserUpdate) ClearTen() *UserUpdate {
uu.mutation.ClearTen()
return uu
}
// SetTenSu sets the "ten_su" field.
func (uu *UserUpdate) SetTenSu(i int) *UserUpdate {
uu.mutation.ResetTenSu()
uu.mutation.SetTenSu(i)
return uu
}
// SetNillableTenSu sets the "ten_su" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenSu(i *int) *UserUpdate {
if i != nil {
uu.SetTenSu(*i)
}
return uu
}
// AddTenSu adds i to the "ten_su" field.
func (uu *UserUpdate) AddTenSu(i int) *UserUpdate {
uu.mutation.AddTenSu(i)
return uu
}
// ClearTenSu clears the value of the "ten_su" field.
func (uu *UserUpdate) ClearTenSu() *UserUpdate {
uu.mutation.ClearTenSu()
return uu
}
// SetTenKai sets the "ten_kai" field.
func (uu *UserUpdate) SetTenKai(i int) *UserUpdate {
uu.mutation.ResetTenKai()
uu.mutation.SetTenKai(i)
return uu
}
// SetNillableTenKai sets the "ten_kai" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenKai(i *int) *UserUpdate {
if i != nil {
uu.SetTenKai(*i)
}
return uu
}
// AddTenKai adds i to the "ten_kai" field.
func (uu *UserUpdate) AddTenKai(i int) *UserUpdate {
uu.mutation.AddTenKai(i)
return uu
}
// ClearTenKai clears the value of the "ten_kai" field.
func (uu *UserUpdate) ClearTenKai() *UserUpdate {
uu.mutation.ClearTenKai()
return uu
}
// SetAiten sets the "aiten" field.
func (uu *UserUpdate) SetAiten(i int) *UserUpdate {
uu.mutation.ResetAiten()
uu.mutation.SetAiten(i)
return uu
}
// SetNillableAiten sets the "aiten" field if the given value is not nil.
func (uu *UserUpdate) SetNillableAiten(i *int) *UserUpdate {
if i != nil {
uu.SetAiten(*i)
}
return uu
}
// AddAiten adds i to the "aiten" field.
func (uu *UserUpdate) AddAiten(i int) *UserUpdate {
uu.mutation.AddAiten(i)
return uu
}
// ClearAiten clears the value of the "aiten" field.
func (uu *UserUpdate) ClearAiten() *UserUpdate {
uu.mutation.ClearAiten()
return uu
}
// SetTenCard sets the "ten_card" field.
func (uu *UserUpdate) SetTenCard(s string) *UserUpdate {
uu.mutation.SetTenCard(s)
return uu
}
// SetNillableTenCard sets the "ten_card" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenCard(s *string) *UserUpdate {
if s != nil {
uu.SetTenCard(*s)
}
return uu
}
// ClearTenCard clears the value of the "ten_card" field.
func (uu *UserUpdate) ClearTenCard() *UserUpdate {
uu.mutation.ClearTenCard()
return uu
}
// SetTenDelete sets the "ten_delete" field.
func (uu *UserUpdate) SetTenDelete(s string) *UserUpdate {
uu.mutation.SetTenDelete(s)
return uu
}
// SetNillableTenDelete sets the "ten_delete" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenDelete(s *string) *UserUpdate {
if s != nil {
uu.SetTenDelete(*s)
}
return uu
}
// ClearTenDelete clears the value of the "ten_delete" field.
func (uu *UserUpdate) ClearTenDelete() *UserUpdate {
uu.mutation.ClearTenDelete()
return uu
}
// SetTenPost sets the "ten_post" field.
func (uu *UserUpdate) SetTenPost(s string) *UserUpdate {
uu.mutation.SetTenPost(s)
return uu
}
// SetNillableTenPost sets the "ten_post" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenPost(s *string) *UserUpdate {
if s != nil {
uu.SetTenPost(*s)
}
return uu
}
// ClearTenPost clears the value of the "ten_post" field.
func (uu *UserUpdate) ClearTenPost() *UserUpdate {
uu.mutation.ClearTenPost()
return uu
}
// SetTenGet sets the "ten_get" field.
func (uu *UserUpdate) SetTenGet(s string) *UserUpdate {
uu.mutation.SetTenGet(s)
return uu
}
// SetNillableTenGet sets the "ten_get" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenGet(s *string) *UserUpdate {
if s != nil {
uu.SetTenGet(*s)
}
return uu
}
// ClearTenGet clears the value of the "ten_get" field.
func (uu *UserUpdate) ClearTenGet() *UserUpdate {
uu.mutation.ClearTenGet()
return uu
}
// SetTenAt sets the "ten_at" field.
func (uu *UserUpdate) SetTenAt(t time.Time) *UserUpdate {
uu.mutation.SetTenAt(t)
return uu
}
// SetNillableTenAt sets the "ten_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableTenAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetTenAt(*t)
}
return uu
}
// ClearTenAt clears the value of the "ten_at" field.
func (uu *UserUpdate) ClearTenAt() *UserUpdate {
uu.mutation.ClearTenAt()
return uu
}
// SetNext sets the "next" field.
func (uu *UserUpdate) SetNext(s string) *UserUpdate {
uu.mutation.SetNext(s)
return uu
}
// SetNillableNext sets the "next" field if the given value is not nil.
func (uu *UserUpdate) SetNillableNext(s *string) *UserUpdate {
if s != nil {
uu.SetNext(*s)
}
return uu
}
// ClearNext clears the value of the "next" field.
func (uu *UserUpdate) ClearNext() *UserUpdate {
uu.mutation.ClearNext()
return uu
}
// SetRoom sets the "room" field.
func (uu *UserUpdate) SetRoom(i int) *UserUpdate {
uu.mutation.ResetRoom()
uu.mutation.SetRoom(i)
return uu
}
// SetNillableRoom sets the "room" field if the given value is not nil.
func (uu *UserUpdate) SetNillableRoom(i *int) *UserUpdate {
if i != nil {
uu.SetRoom(*i)
}
return uu
}
// AddRoom adds i to the "room" field.
func (uu *UserUpdate) AddRoom(i int) *UserUpdate {
uu.mutation.AddRoom(i)
return uu
}
// ClearRoom clears the value of the "room" field.
func (uu *UserUpdate) ClearRoom() *UserUpdate {
uu.mutation.ClearRoom()
return uu
}
// SetModel sets the "model" field.
func (uu *UserUpdate) SetModel(b bool) *UserUpdate {
uu.mutation.SetModel(b)
return uu
}
// SetNillableModel sets the "model" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModel(b *bool) *UserUpdate {
if b != nil {
uu.SetModel(*b)
}
return uu
}
// ClearModel clears the value of the "model" field.
func (uu *UserUpdate) ClearModel() *UserUpdate {
uu.mutation.ClearModel()
return uu
}
// SetModelAt sets the "model_at" field.
func (uu *UserUpdate) SetModelAt(t time.Time) *UserUpdate {
uu.mutation.SetModelAt(t)
return uu
}
// SetNillableModelAt sets the "model_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetModelAt(*t)
}
return uu
}
// ClearModelAt clears the value of the "model_at" field.
func (uu *UserUpdate) ClearModelAt() *UserUpdate {
uu.mutation.ClearModelAt()
return uu
}
// SetModelAttack sets the "model_attack" field.
func (uu *UserUpdate) SetModelAttack(i int) *UserUpdate {
uu.mutation.ResetModelAttack()
uu.mutation.SetModelAttack(i)
return uu
}
// SetNillableModelAttack sets the "model_attack" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelAttack(i *int) *UserUpdate {
if i != nil {
uu.SetModelAttack(*i)
}
return uu
}
// AddModelAttack adds i to the "model_attack" field.
func (uu *UserUpdate) AddModelAttack(i int) *UserUpdate {
uu.mutation.AddModelAttack(i)
return uu
}
// ClearModelAttack clears the value of the "model_attack" field.
func (uu *UserUpdate) ClearModelAttack() *UserUpdate {
uu.mutation.ClearModelAttack()
return uu
}
// SetModelLimit sets the "model_limit" field.
func (uu *UserUpdate) SetModelLimit(i int) *UserUpdate {
uu.mutation.ResetModelLimit()
uu.mutation.SetModelLimit(i)
return uu
}
// SetNillableModelLimit sets the "model_limit" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelLimit(i *int) *UserUpdate {
if i != nil {
uu.SetModelLimit(*i)
}
return uu
}
// AddModelLimit adds i to the "model_limit" field.
func (uu *UserUpdate) AddModelLimit(i int) *UserUpdate {
uu.mutation.AddModelLimit(i)
return uu
}
// ClearModelLimit clears the value of the "model_limit" field.
func (uu *UserUpdate) ClearModelLimit() *UserUpdate {
uu.mutation.ClearModelLimit()
return uu
}
// SetModelSkill sets the "model_skill" field.
func (uu *UserUpdate) SetModelSkill(i int) *UserUpdate {
uu.mutation.ResetModelSkill()
uu.mutation.SetModelSkill(i)
return uu
}
// SetNillableModelSkill sets the "model_skill" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelSkill(i *int) *UserUpdate {
if i != nil {
uu.SetModelSkill(*i)
}
return uu
}
// AddModelSkill adds i to the "model_skill" field.
func (uu *UserUpdate) AddModelSkill(i int) *UserUpdate {
uu.mutation.AddModelSkill(i)
return uu
}
// ClearModelSkill clears the value of the "model_skill" field.
func (uu *UserUpdate) ClearModelSkill() *UserUpdate {
uu.mutation.ClearModelSkill()
return uu
}
// SetModelMode sets the "model_mode" field.
func (uu *UserUpdate) SetModelMode(i int) *UserUpdate {
uu.mutation.ResetModelMode()
uu.mutation.SetModelMode(i)
return uu
}
// SetNillableModelMode sets the "model_mode" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelMode(i *int) *UserUpdate {
if i != nil {
uu.SetModelMode(*i)
}
return uu
}
// AddModelMode adds i to the "model_mode" field.
func (uu *UserUpdate) AddModelMode(i int) *UserUpdate {
uu.mutation.AddModelMode(i)
return uu
}
// ClearModelMode clears the value of the "model_mode" field.
func (uu *UserUpdate) ClearModelMode() *UserUpdate {
uu.mutation.ClearModelMode()
return uu
}
// SetModelCritical sets the "model_critical" field.
func (uu *UserUpdate) SetModelCritical(i int) *UserUpdate {
uu.mutation.ResetModelCritical()
uu.mutation.SetModelCritical(i)
return uu
}
// SetNillableModelCritical sets the "model_critical" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelCritical(i *int) *UserUpdate {
if i != nil {
uu.SetModelCritical(*i)
}
return uu
}
// AddModelCritical adds i to the "model_critical" field.
func (uu *UserUpdate) AddModelCritical(i int) *UserUpdate {
uu.mutation.AddModelCritical(i)
return uu
}
// ClearModelCritical clears the value of the "model_critical" field.
func (uu *UserUpdate) ClearModelCritical() *UserUpdate {
uu.mutation.ClearModelCritical()
return uu
}
// SetModelCriticalD sets the "model_critical_d" field.
func (uu *UserUpdate) SetModelCriticalD(i int) *UserUpdate {
uu.mutation.ResetModelCriticalD()
uu.mutation.SetModelCriticalD(i)
return uu
}
// SetNillableModelCriticalD sets the "model_critical_d" field if the given value is not nil.
func (uu *UserUpdate) SetNillableModelCriticalD(i *int) *UserUpdate {
if i != nil {
uu.SetModelCriticalD(*i)
}
return uu
}
// AddModelCriticalD adds i to the "model_critical_d" field.
func (uu *UserUpdate) AddModelCriticalD(i int) *UserUpdate {
uu.mutation.AddModelCriticalD(i)
return uu
}
// ClearModelCriticalD clears the value of the "model_critical_d" field.
func (uu *UserUpdate) ClearModelCriticalD() *UserUpdate {
uu.mutation.ClearModelCriticalD()
return uu
}
// SetGame sets the "game" field.
func (uu *UserUpdate) SetGame(b bool) *UserUpdate {
uu.mutation.SetGame(b)
return uu
}
// SetNillableGame sets the "game" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGame(b *bool) *UserUpdate {
if b != nil {
uu.SetGame(*b)
}
return uu
}
// ClearGame clears the value of the "game" field.
func (uu *UserUpdate) ClearGame() *UserUpdate {
uu.mutation.ClearGame()
return uu
}
// SetGameTest sets the "game_test" field.
func (uu *UserUpdate) SetGameTest(b bool) *UserUpdate {
uu.mutation.SetGameTest(b)
return uu
}
// SetNillableGameTest sets the "game_test" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameTest(b *bool) *UserUpdate {
if b != nil {
uu.SetGameTest(*b)
}
return uu
}
// ClearGameTest clears the value of the "game_test" field.
func (uu *UserUpdate) ClearGameTest() *UserUpdate {
uu.mutation.ClearGameTest()
return uu
}
// SetGameEnd sets the "game_end" field.
func (uu *UserUpdate) SetGameEnd(b bool) *UserUpdate {
uu.mutation.SetGameEnd(b)
return uu
}
// SetNillableGameEnd sets the "game_end" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameEnd(b *bool) *UserUpdate {
if b != nil {
uu.SetGameEnd(*b)
}
return uu
}
// ClearGameEnd clears the value of the "game_end" field.
func (uu *UserUpdate) ClearGameEnd() *UserUpdate {
uu.mutation.ClearGameEnd()
return uu
}
// SetGameAccount sets the "game_account" field.
func (uu *UserUpdate) SetGameAccount(b bool) *UserUpdate {
uu.mutation.SetGameAccount(b)
return uu
}
// SetNillableGameAccount sets the "game_account" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameAccount(b *bool) *UserUpdate {
if b != nil {
uu.SetGameAccount(*b)
}
return uu
}
// ClearGameAccount clears the value of the "game_account" field.
func (uu *UserUpdate) ClearGameAccount() *UserUpdate {
uu.mutation.ClearGameAccount()
return uu
}
// SetGameLv sets the "game_lv" field.
func (uu *UserUpdate) SetGameLv(i int) *UserUpdate {
uu.mutation.ResetGameLv()
uu.mutation.SetGameLv(i)
return uu
}
// SetNillableGameLv sets the "game_lv" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameLv(i *int) *UserUpdate {
if i != nil {
uu.SetGameLv(*i)
}
return uu
}
// AddGameLv adds i to the "game_lv" field.
func (uu *UserUpdate) AddGameLv(i int) *UserUpdate {
uu.mutation.AddGameLv(i)
return uu
}
// ClearGameLv clears the value of the "game_lv" field.
func (uu *UserUpdate) ClearGameLv() *UserUpdate {
uu.mutation.ClearGameLv()
return uu
}
// SetGameExp sets the "game_exp" field.
func (uu *UserUpdate) SetGameExp(i int) *UserUpdate {
uu.mutation.ResetGameExp()
uu.mutation.SetGameExp(i)
return uu
}
// SetNillableGameExp sets the "game_exp" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameExp(i *int) *UserUpdate {
if i != nil {
uu.SetGameExp(*i)
}
return uu
}
// AddGameExp adds i to the "game_exp" field.
func (uu *UserUpdate) AddGameExp(i int) *UserUpdate {
uu.mutation.AddGameExp(i)
return uu
}
// ClearGameExp clears the value of the "game_exp" field.
func (uu *UserUpdate) ClearGameExp() *UserUpdate {
uu.mutation.ClearGameExp()
return uu
}
// SetGameStory sets the "game_story" field.
func (uu *UserUpdate) SetGameStory(i int) *UserUpdate {
uu.mutation.ResetGameStory()
uu.mutation.SetGameStory(i)
return uu
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameStory(i *int) *UserUpdate {
if i != nil {
uu.SetGameStory(*i)
}
return uu
}
// AddGameStory adds i to the "game_story" field.
func (uu *UserUpdate) AddGameStory(i int) *UserUpdate {
uu.mutation.AddGameStory(i)
return uu
}
// ClearGameStory clears the value of the "game_story" field.
func (uu *UserUpdate) ClearGameStory() *UserUpdate {
uu.mutation.ClearGameStory()
return uu
}
// SetGameLimit sets the "game_limit" field.
func (uu *UserUpdate) SetGameLimit(b bool) *UserUpdate {
uu.mutation.SetGameLimit(b)
return uu
}
// SetNillableGameLimit sets the "game_limit" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameLimit(b *bool) *UserUpdate {
if b != nil {
uu.SetGameLimit(*b)
}
return uu
}
// ClearGameLimit clears the value of the "game_limit" field.
func (uu *UserUpdate) ClearGameLimit() *UserUpdate {
uu.mutation.ClearGameLimit()
return uu
}
// SetCoin sets the "coin" field.
func (uu *UserUpdate) SetCoin(i int) *UserUpdate {
uu.mutation.ResetCoin()
uu.mutation.SetCoin(i)
return uu
}
// SetNillableCoin sets the "coin" field if the given value is not nil.
func (uu *UserUpdate) SetNillableCoin(i *int) *UserUpdate {
if i != nil {
uu.SetCoin(*i)
}
return uu
}
// AddCoin adds i to the "coin" field.
func (uu *UserUpdate) AddCoin(i int) *UserUpdate {
uu.mutation.AddCoin(i)
return uu
}
// ClearCoin clears the value of the "coin" field.
func (uu *UserUpdate) ClearCoin() *UserUpdate {
uu.mutation.ClearCoin()
return uu
}
// SetCoinOpen sets the "coin_open" field.
func (uu *UserUpdate) SetCoinOpen(b bool) *UserUpdate {
uu.mutation.SetCoinOpen(b)
return uu
}
// SetNillableCoinOpen sets the "coin_open" field if the given value is not nil.
func (uu *UserUpdate) SetNillableCoinOpen(b *bool) *UserUpdate {
if b != nil {
uu.SetCoinOpen(*b)
}
return uu
}
// ClearCoinOpen clears the value of the "coin_open" field.
func (uu *UserUpdate) ClearCoinOpen() *UserUpdate {
uu.mutation.ClearCoinOpen()
return uu
}
// SetCoinAt sets the "coin_at" field.
func (uu *UserUpdate) SetCoinAt(t time.Time) *UserUpdate {
uu.mutation.SetCoinAt(t)
return uu
}
// SetNillableCoinAt sets the "coin_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableCoinAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetCoinAt(*t)
}
return uu
}
// ClearCoinAt clears the value of the "coin_at" field.
func (uu *UserUpdate) ClearCoinAt() *UserUpdate {
uu.mutation.ClearCoinAt()
return uu
}
// AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate {
uu.mutation.AddCardIDs(ids...)
return uu
}
// AddCard adds the "card" edges to the Card entity.
func (uu *UserUpdate) AddCard(c ...*Card) *UserUpdate {
ids := make([]int, len(c))
for i := range c {
ids[i] = c[i].ID
}
return uu.AddCardIDs(ids...)
}
// AddUeIDs adds the "ue" edge to the Ue entity by IDs.
func (uu *UserUpdate) AddUeIDs(ids ...int) *UserUpdate {
uu.mutation.AddUeIDs(ids...)
return uu
}
// AddUe adds the "ue" edges to the Ue entity.
func (uu *UserUpdate) AddUe(u ...*Ue) *UserUpdate {
ids := make([]int, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uu.AddUeIDs(ids...)
}
// AddMaIDs adds the "ma" edge to the Ma entity by IDs.
func (uu *UserUpdate) AddMaIDs(ids ...int) *UserUpdate {
uu.mutation.AddMaIDs(ids...)
return uu
}
// AddMa adds the "ma" edges to the Ma entity.
func (uu *UserUpdate) AddMa(m ...*Ma) *UserUpdate {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return uu.AddMaIDs(ids...)
}
// AddSevIDs adds the "sev" edge to the Sev entity by IDs.
func (uu *UserUpdate) AddSevIDs(ids ...int) *UserUpdate {
uu.mutation.AddSevIDs(ids...)
return uu
}
// AddSev adds the "sev" edges to the Sev entity.
func (uu *UserUpdate) AddSev(s ...*Sev) *UserUpdate {
ids := make([]int, len(s))
for i := range s {
ids[i] = s[i].ID
}
return uu.AddSevIDs(ids...)
}
// Mutation returns the UserMutation object of the builder.
func (uu *UserUpdate) Mutation() *UserMutation {
return uu.mutation
}
// ClearCard clears all "card" edges to the Card entity.
func (uu *UserUpdate) ClearCard() *UserUpdate {
uu.mutation.ClearCard()
return uu
}
// RemoveCardIDs removes the "card" edge to Card entities by IDs.
func (uu *UserUpdate) RemoveCardIDs(ids ...int) *UserUpdate {
uu.mutation.RemoveCardIDs(ids...)
return uu
}
// RemoveCard removes "card" edges to Card entities.
func (uu *UserUpdate) RemoveCard(c ...*Card) *UserUpdate {
ids := make([]int, len(c))
for i := range c {
ids[i] = c[i].ID
}
return uu.RemoveCardIDs(ids...)
}
// ClearUe clears all "ue" edges to the Ue entity.
func (uu *UserUpdate) ClearUe() *UserUpdate {
uu.mutation.ClearUe()
return uu
}
// RemoveUeIDs removes the "ue" edge to Ue entities by IDs.
func (uu *UserUpdate) RemoveUeIDs(ids ...int) *UserUpdate {
uu.mutation.RemoveUeIDs(ids...)
return uu
}
// RemoveUe removes "ue" edges to Ue entities.
func (uu *UserUpdate) RemoveUe(u ...*Ue) *UserUpdate {
ids := make([]int, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uu.RemoveUeIDs(ids...)
}
// ClearMa clears all "ma" edges to the Ma entity.
func (uu *UserUpdate) ClearMa() *UserUpdate {
uu.mutation.ClearMa()
return uu
}
// RemoveMaIDs removes the "ma" edge to Ma entities by IDs.
func (uu *UserUpdate) RemoveMaIDs(ids ...int) *UserUpdate {
uu.mutation.RemoveMaIDs(ids...)
return uu
}
// RemoveMa removes "ma" edges to Ma entities.
func (uu *UserUpdate) RemoveMa(m ...*Ma) *UserUpdate {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return uu.RemoveMaIDs(ids...)
}
// ClearSev clears all "sev" edges to the Sev entity.
func (uu *UserUpdate) ClearSev() *UserUpdate {
uu.mutation.ClearSev()
return uu
}
// RemoveSevIDs removes the "sev" edge to Sev entities by IDs.
func (uu *UserUpdate) RemoveSevIDs(ids ...int) *UserUpdate {
uu.mutation.RemoveSevIDs(ids...)
return uu
}
// RemoveSev removes "sev" edges to Sev entities.
func (uu *UserUpdate) RemoveSev(s ...*Sev) *UserUpdate {
ids := make([]int, len(s))
for i := range s {
ids[i] = s[i].ID
}
return uu.RemoveSevIDs(ids...)
}
// Save executes the query and returns the number of nodes affected by the update operation.
func (uu *UserUpdate) Save(ctx context.Context) (int, error) {
return withHooks[int, UserMutation](ctx, uu.sqlSave, uu.mutation, uu.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (uu *UserUpdate) SaveX(ctx context.Context) int {
affected, err := uu.Save(ctx)
if err != nil {
panic(err)
}
return affected
}
// Exec executes the query.
func (uu *UserUpdate) Exec(ctx context.Context) error {
_, err := uu.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uu *UserUpdate) ExecX(ctx context.Context) {
if err := uu.Exec(ctx); err != nil {
panic(err)
}
}
func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
_spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt))
if ps := uu.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := uu.mutation.Did(); ok {
_spec.SetField(user.FieldDid, field.TypeString, value)
}
if uu.mutation.DidCleared() {
_spec.ClearField(user.FieldDid, field.TypeString)
}
if value, ok := uu.mutation.Member(); ok {
_spec.SetField(user.FieldMember, field.TypeBool, value)
}
if uu.mutation.MemberCleared() {
_spec.ClearField(user.FieldMember, field.TypeBool)
}
if value, ok := uu.mutation.Book(); ok {
_spec.SetField(user.FieldBook, field.TypeBool, value)
}
if uu.mutation.BookCleared() {
_spec.ClearField(user.FieldBook, field.TypeBool)
}
if value, ok := uu.mutation.Manga(); ok {
_spec.SetField(user.FieldManga, field.TypeBool, value)
}
if uu.mutation.MangaCleared() {
_spec.ClearField(user.FieldManga, field.TypeBool)
}
if value, ok := uu.mutation.Badge(); ok {
_spec.SetField(user.FieldBadge, field.TypeBool, value)
}
if uu.mutation.BadgeCleared() {
_spec.ClearField(user.FieldBadge, field.TypeBool)
}
if value, ok := uu.mutation.Bsky(); ok {
_spec.SetField(user.FieldBsky, field.TypeBool, value)
}
if uu.mutation.BskyCleared() {
_spec.ClearField(user.FieldBsky, field.TypeBool)
}
if value, ok := uu.mutation.Mastodon(); ok {
_spec.SetField(user.FieldMastodon, field.TypeBool, value)
}
if uu.mutation.MastodonCleared() {
_spec.ClearField(user.FieldMastodon, field.TypeBool)
}
if value, ok := uu.mutation.Delete(); ok {
_spec.SetField(user.FieldDelete, field.TypeBool, value)
}
if uu.mutation.DeleteCleared() {
_spec.ClearField(user.FieldDelete, field.TypeBool)
}
if value, ok := uu.mutation.Handle(); ok {
_spec.SetField(user.FieldHandle, field.TypeBool, value)
}
if uu.mutation.HandleCleared() {
_spec.ClearField(user.FieldHandle, field.TypeBool)
}
if value, ok := uu.mutation.Token(); ok {
_spec.SetField(user.FieldToken, field.TypeString, value)
}
if uu.mutation.TokenCleared() {
_spec.ClearField(user.FieldToken, field.TypeString)
}
if uu.mutation.CreatedAtCleared() {
_spec.ClearField(user.FieldCreatedAt, field.TypeTime)
}
if value, ok := uu.mutation.UpdatedAt(); ok {
_spec.SetField(user.FieldUpdatedAt, field.TypeTime, value)
}
if uu.mutation.UpdatedAtCleared() {
_spec.ClearField(user.FieldUpdatedAt, field.TypeTime)
}
if value, ok := uu.mutation.RaidAt(); ok {
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
}
if uu.mutation.RaidAtCleared() {
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
}
if value, ok := uu.mutation.ServerAt(); ok {
_spec.SetField(user.FieldServerAt, field.TypeTime, value)
}
if uu.mutation.ServerAtCleared() {
_spec.ClearField(user.FieldServerAt, field.TypeTime)
}
if value, ok := uu.mutation.EggAt(); ok {
_spec.SetField(user.FieldEggAt, field.TypeTime, value)
}
if uu.mutation.EggAtCleared() {
_spec.ClearField(user.FieldEggAt, field.TypeTime)
}
if value, ok := uu.mutation.Luck(); ok {
_spec.SetField(user.FieldLuck, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLuck(); ok {
_spec.AddField(user.FieldLuck, field.TypeInt, value)
}
if uu.mutation.LuckCleared() {
_spec.ClearField(user.FieldLuck, field.TypeInt)
}
if value, ok := uu.mutation.LuckAt(); ok {
_spec.SetField(user.FieldLuckAt, field.TypeTime, value)
}
if uu.mutation.LuckAtCleared() {
_spec.ClearField(user.FieldLuckAt, field.TypeTime)
}
if value, ok := uu.mutation.Like(); ok {
_spec.SetField(user.FieldLike, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLike(); ok {
_spec.AddField(user.FieldLike, field.TypeInt, value)
}
if uu.mutation.LikeCleared() {
_spec.ClearField(user.FieldLike, field.TypeInt)
}
if value, ok := uu.mutation.LikeRank(); ok {
_spec.SetField(user.FieldLikeRank, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLikeRank(); ok {
_spec.AddField(user.FieldLikeRank, field.TypeInt, value)
}
if uu.mutation.LikeRankCleared() {
_spec.ClearField(user.FieldLikeRank, field.TypeInt)
}
if value, ok := uu.mutation.LikeAt(); ok {
_spec.SetField(user.FieldLikeAt, field.TypeTime, value)
}
if uu.mutation.LikeAtCleared() {
_spec.ClearField(user.FieldLikeAt, field.TypeTime)
}
if value, ok := uu.mutation.Fav(); ok {
_spec.SetField(user.FieldFav, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedFav(); ok {
_spec.AddField(user.FieldFav, field.TypeInt, value)
}
if uu.mutation.FavCleared() {
_spec.ClearField(user.FieldFav, field.TypeInt)
}
if value, ok := uu.mutation.Ten(); ok {
_spec.SetField(user.FieldTen, field.TypeBool, value)
}
if uu.mutation.TenCleared() {
_spec.ClearField(user.FieldTen, field.TypeBool)
}
if value, ok := uu.mutation.TenSu(); ok {
_spec.SetField(user.FieldTenSu, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedTenSu(); ok {
_spec.AddField(user.FieldTenSu, field.TypeInt, value)
}
if uu.mutation.TenSuCleared() {
_spec.ClearField(user.FieldTenSu, field.TypeInt)
}
if value, ok := uu.mutation.TenKai(); ok {
_spec.SetField(user.FieldTenKai, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedTenKai(); ok {
_spec.AddField(user.FieldTenKai, field.TypeInt, value)
}
if uu.mutation.TenKaiCleared() {
_spec.ClearField(user.FieldTenKai, field.TypeInt)
}
if value, ok := uu.mutation.Aiten(); ok {
_spec.SetField(user.FieldAiten, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedAiten(); ok {
_spec.AddField(user.FieldAiten, field.TypeInt, value)
}
if uu.mutation.AitenCleared() {
_spec.ClearField(user.FieldAiten, field.TypeInt)
}
if value, ok := uu.mutation.TenCard(); ok {
_spec.SetField(user.FieldTenCard, field.TypeString, value)
}
if uu.mutation.TenCardCleared() {
_spec.ClearField(user.FieldTenCard, field.TypeString)
}
if value, ok := uu.mutation.TenDelete(); ok {
_spec.SetField(user.FieldTenDelete, field.TypeString, value)
}
if uu.mutation.TenDeleteCleared() {
_spec.ClearField(user.FieldTenDelete, field.TypeString)
}
if value, ok := uu.mutation.TenPost(); ok {
_spec.SetField(user.FieldTenPost, field.TypeString, value)
}
if uu.mutation.TenPostCleared() {
_spec.ClearField(user.FieldTenPost, field.TypeString)
}
if value, ok := uu.mutation.TenGet(); ok {
_spec.SetField(user.FieldTenGet, field.TypeString, value)
}
if uu.mutation.TenGetCleared() {
_spec.ClearField(user.FieldTenGet, field.TypeString)
}
if value, ok := uu.mutation.TenAt(); ok {
_spec.SetField(user.FieldTenAt, field.TypeTime, value)
}
if uu.mutation.TenAtCleared() {
_spec.ClearField(user.FieldTenAt, field.TypeTime)
}
if value, ok := uu.mutation.Next(); ok {
_spec.SetField(user.FieldNext, field.TypeString, value)
}
if uu.mutation.NextCleared() {
_spec.ClearField(user.FieldNext, field.TypeString)
}
if value, ok := uu.mutation.Room(); ok {
_spec.SetField(user.FieldRoom, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedRoom(); ok {
_spec.AddField(user.FieldRoom, field.TypeInt, value)
}
if uu.mutation.RoomCleared() {
_spec.ClearField(user.FieldRoom, field.TypeInt)
}
if value, ok := uu.mutation.Model(); ok {
_spec.SetField(user.FieldModel, field.TypeBool, value)
}
if uu.mutation.ModelCleared() {
_spec.ClearField(user.FieldModel, field.TypeBool)
}
if value, ok := uu.mutation.ModelAt(); ok {
_spec.SetField(user.FieldModelAt, field.TypeTime, value)
}
if uu.mutation.ModelAtCleared() {
_spec.ClearField(user.FieldModelAt, field.TypeTime)
}
if value, ok := uu.mutation.ModelAttack(); ok {
_spec.SetField(user.FieldModelAttack, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelAttack(); ok {
_spec.AddField(user.FieldModelAttack, field.TypeInt, value)
}
if uu.mutation.ModelAttackCleared() {
_spec.ClearField(user.FieldModelAttack, field.TypeInt)
}
if value, ok := uu.mutation.ModelLimit(); ok {
_spec.SetField(user.FieldModelLimit, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelLimit(); ok {
_spec.AddField(user.FieldModelLimit, field.TypeInt, value)
}
if uu.mutation.ModelLimitCleared() {
_spec.ClearField(user.FieldModelLimit, field.TypeInt)
}
if value, ok := uu.mutation.ModelSkill(); ok {
_spec.SetField(user.FieldModelSkill, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelSkill(); ok {
_spec.AddField(user.FieldModelSkill, field.TypeInt, value)
}
if uu.mutation.ModelSkillCleared() {
_spec.ClearField(user.FieldModelSkill, field.TypeInt)
}
if value, ok := uu.mutation.ModelMode(); ok {
_spec.SetField(user.FieldModelMode, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelMode(); ok {
_spec.AddField(user.FieldModelMode, field.TypeInt, value)
}
if uu.mutation.ModelModeCleared() {
_spec.ClearField(user.FieldModelMode, field.TypeInt)
}
if value, ok := uu.mutation.ModelCritical(); ok {
_spec.SetField(user.FieldModelCritical, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelCritical(); ok {
_spec.AddField(user.FieldModelCritical, field.TypeInt, value)
}
if uu.mutation.ModelCriticalCleared() {
_spec.ClearField(user.FieldModelCritical, field.TypeInt)
}
if value, ok := uu.mutation.ModelCriticalD(); ok {
_spec.SetField(user.FieldModelCriticalD, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedModelCriticalD(); ok {
_spec.AddField(user.FieldModelCriticalD, field.TypeInt, value)
}
if uu.mutation.ModelCriticalDCleared() {
_spec.ClearField(user.FieldModelCriticalD, field.TypeInt)
}
if value, ok := uu.mutation.Game(); ok {
_spec.SetField(user.FieldGame, field.TypeBool, value)
}
if uu.mutation.GameCleared() {
_spec.ClearField(user.FieldGame, field.TypeBool)
}
if value, ok := uu.mutation.GameTest(); ok {
_spec.SetField(user.FieldGameTest, field.TypeBool, value)
}
if uu.mutation.GameTestCleared() {
_spec.ClearField(user.FieldGameTest, field.TypeBool)
}
if value, ok := uu.mutation.GameEnd(); ok {
_spec.SetField(user.FieldGameEnd, field.TypeBool, value)
}
if uu.mutation.GameEndCleared() {
_spec.ClearField(user.FieldGameEnd, field.TypeBool)
}
if value, ok := uu.mutation.GameAccount(); ok {
_spec.SetField(user.FieldGameAccount, field.TypeBool, value)
}
if uu.mutation.GameAccountCleared() {
_spec.ClearField(user.FieldGameAccount, field.TypeBool)
}
if value, ok := uu.mutation.GameLv(); ok {
_spec.SetField(user.FieldGameLv, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameLv(); ok {
_spec.AddField(user.FieldGameLv, field.TypeInt, value)
}
if uu.mutation.GameLvCleared() {
_spec.ClearField(user.FieldGameLv, field.TypeInt)
}
if value, ok := uu.mutation.GameExp(); ok {
_spec.SetField(user.FieldGameExp, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameExp(); ok {
_spec.AddField(user.FieldGameExp, field.TypeInt, value)
}
if uu.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uu.mutation.GameStory(); ok {
_spec.SetField(user.FieldGameStory, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameStory(); ok {
_spec.AddField(user.FieldGameStory, field.TypeInt, value)
}
if uu.mutation.GameStoryCleared() {
_spec.ClearField(user.FieldGameStory, field.TypeInt)
}
if value, ok := uu.mutation.GameLimit(); ok {
_spec.SetField(user.FieldGameLimit, field.TypeBool, value)
}
if uu.mutation.GameLimitCleared() {
_spec.ClearField(user.FieldGameLimit, field.TypeBool)
}
if value, ok := uu.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedCoin(); ok {
_spec.AddField(user.FieldCoin, field.TypeInt, value)
}
if uu.mutation.CoinCleared() {
_spec.ClearField(user.FieldCoin, field.TypeInt)
}
if value, ok := uu.mutation.CoinOpen(); ok {
_spec.SetField(user.FieldCoinOpen, field.TypeBool, value)
}
if uu.mutation.CoinOpenCleared() {
_spec.ClearField(user.FieldCoinOpen, field.TypeBool)
}
if value, ok := uu.mutation.CoinAt(); ok {
_spec.SetField(user.FieldCoinAt, field.TypeTime, value)
}
if uu.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
}
if uu.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.RemovedCardIDs(); len(nodes) > 0 && !uu.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.CardIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uu.mutation.UeCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.RemovedUeIDs(); len(nodes) > 0 && !uu.mutation.UeCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.UeIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uu.mutation.MaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.RemovedMaIDs(); len(nodes) > 0 && !uu.mutation.MaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.MaIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uu.mutation.SevCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.RemovedSevIDs(); len(nodes) > 0 && !uu.mutation.SevCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.SevIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if n, err = sqlgraph.UpdateNodes(ctx, uu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{user.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
uu.mutation.done = true
return n, nil
}
// UserUpdateOne is the builder for updating a single User entity.
type UserUpdateOne struct {
config
fields []string
hooks []Hook
mutation *UserMutation
}
// SetDid sets the "did" field.
func (uuo *UserUpdateOne) SetDid(s string) *UserUpdateOne {
uuo.mutation.SetDid(s)
return uuo
}
// SetNillableDid sets the "did" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableDid(s *string) *UserUpdateOne {
if s != nil {
uuo.SetDid(*s)
}
return uuo
}
// ClearDid clears the value of the "did" field.
func (uuo *UserUpdateOne) ClearDid() *UserUpdateOne {
uuo.mutation.ClearDid()
return uuo
}
// SetMember sets the "member" field.
func (uuo *UserUpdateOne) SetMember(b bool) *UserUpdateOne {
uuo.mutation.SetMember(b)
return uuo
}
// SetNillableMember sets the "member" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableMember(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetMember(*b)
}
return uuo
}
// ClearMember clears the value of the "member" field.
func (uuo *UserUpdateOne) ClearMember() *UserUpdateOne {
uuo.mutation.ClearMember()
return uuo
}
// SetBook sets the "book" field.
func (uuo *UserUpdateOne) SetBook(b bool) *UserUpdateOne {
uuo.mutation.SetBook(b)
return uuo
}
// SetNillableBook sets the "book" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableBook(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetBook(*b)
}
return uuo
}
// ClearBook clears the value of the "book" field.
func (uuo *UserUpdateOne) ClearBook() *UserUpdateOne {
uuo.mutation.ClearBook()
return uuo
}
// SetManga sets the "manga" field.
func (uuo *UserUpdateOne) SetManga(b bool) *UserUpdateOne {
uuo.mutation.SetManga(b)
return uuo
}
// SetNillableManga sets the "manga" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableManga(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetManga(*b)
}
return uuo
}
// ClearManga clears the value of the "manga" field.
func (uuo *UserUpdateOne) ClearManga() *UserUpdateOne {
uuo.mutation.ClearManga()
return uuo
}
// SetBadge sets the "badge" field.
func (uuo *UserUpdateOne) SetBadge(b bool) *UserUpdateOne {
uuo.mutation.SetBadge(b)
return uuo
}
// SetNillableBadge sets the "badge" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableBadge(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetBadge(*b)
}
return uuo
}
// ClearBadge clears the value of the "badge" field.
func (uuo *UserUpdateOne) ClearBadge() *UserUpdateOne {
uuo.mutation.ClearBadge()
return uuo
}
// SetBsky sets the "bsky" field.
func (uuo *UserUpdateOne) SetBsky(b bool) *UserUpdateOne {
uuo.mutation.SetBsky(b)
return uuo
}
// SetNillableBsky sets the "bsky" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableBsky(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetBsky(*b)
}
return uuo
}
// ClearBsky clears the value of the "bsky" field.
func (uuo *UserUpdateOne) ClearBsky() *UserUpdateOne {
uuo.mutation.ClearBsky()
return uuo
}
// SetMastodon sets the "mastodon" field.
func (uuo *UserUpdateOne) SetMastodon(b bool) *UserUpdateOne {
uuo.mutation.SetMastodon(b)
return uuo
}
// SetNillableMastodon sets the "mastodon" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableMastodon(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetMastodon(*b)
}
return uuo
}
// ClearMastodon clears the value of the "mastodon" field.
func (uuo *UserUpdateOne) ClearMastodon() *UserUpdateOne {
uuo.mutation.ClearMastodon()
return uuo
}
// SetDelete sets the "delete" field.
func (uuo *UserUpdateOne) SetDelete(b bool) *UserUpdateOne {
uuo.mutation.SetDelete(b)
return uuo
}
// SetNillableDelete sets the "delete" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableDelete(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetDelete(*b)
}
return uuo
}
// ClearDelete clears the value of the "delete" field.
func (uuo *UserUpdateOne) ClearDelete() *UserUpdateOne {
uuo.mutation.ClearDelete()
return uuo
}
// SetHandle sets the "handle" field.
func (uuo *UserUpdateOne) SetHandle(b bool) *UserUpdateOne {
uuo.mutation.SetHandle(b)
return uuo
}
// SetNillableHandle sets the "handle" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableHandle(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetHandle(*b)
}
return uuo
}
// ClearHandle clears the value of the "handle" field.
func (uuo *UserUpdateOne) ClearHandle() *UserUpdateOne {
uuo.mutation.ClearHandle()
return uuo
}
// SetToken sets the "token" field.
func (uuo *UserUpdateOne) SetToken(s string) *UserUpdateOne {
uuo.mutation.SetToken(s)
return uuo
}
// SetNillableToken sets the "token" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableToken(s *string) *UserUpdateOne {
if s != nil {
uuo.SetToken(*s)
}
return uuo
}
// ClearToken clears the value of the "token" field.
func (uuo *UserUpdateOne) ClearToken() *UserUpdateOne {
uuo.mutation.ClearToken()
return uuo
}
// SetUpdatedAt sets the "updated_at" field.
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetUpdatedAt(t)
return uuo
}
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableUpdatedAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetUpdatedAt(*t)
}
return uuo
}
// ClearUpdatedAt clears the value of the "updated_at" field.
func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne {
uuo.mutation.ClearUpdatedAt()
return uuo
}
// SetRaidAt sets the "raid_at" field.
func (uuo *UserUpdateOne) SetRaidAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetRaidAt(t)
return uuo
}
// SetNillableRaidAt sets the "raid_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableRaidAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetRaidAt(*t)
}
return uuo
}
// ClearRaidAt clears the value of the "raid_at" field.
func (uuo *UserUpdateOne) ClearRaidAt() *UserUpdateOne {
uuo.mutation.ClearRaidAt()
return uuo
}
// SetServerAt sets the "server_at" field.
func (uuo *UserUpdateOne) SetServerAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetServerAt(t)
return uuo
}
// SetNillableServerAt sets the "server_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableServerAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetServerAt(*t)
}
return uuo
}
// ClearServerAt clears the value of the "server_at" field.
func (uuo *UserUpdateOne) ClearServerAt() *UserUpdateOne {
uuo.mutation.ClearServerAt()
return uuo
}
// SetEggAt sets the "egg_at" field.
func (uuo *UserUpdateOne) SetEggAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetEggAt(t)
return uuo
}
// SetNillableEggAt sets the "egg_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableEggAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetEggAt(*t)
}
return uuo
}
// ClearEggAt clears the value of the "egg_at" field.
func (uuo *UserUpdateOne) ClearEggAt() *UserUpdateOne {
uuo.mutation.ClearEggAt()
return uuo
}
// SetLuck sets the "luck" field.
func (uuo *UserUpdateOne) SetLuck(i int) *UserUpdateOne {
uuo.mutation.ResetLuck()
uuo.mutation.SetLuck(i)
return uuo
}
// SetNillableLuck sets the "luck" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLuck(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLuck(*i)
}
return uuo
}
// AddLuck adds i to the "luck" field.
func (uuo *UserUpdateOne) AddLuck(i int) *UserUpdateOne {
uuo.mutation.AddLuck(i)
return uuo
}
// ClearLuck clears the value of the "luck" field.
func (uuo *UserUpdateOne) ClearLuck() *UserUpdateOne {
uuo.mutation.ClearLuck()
return uuo
}
// SetLuckAt sets the "luck_at" field.
func (uuo *UserUpdateOne) SetLuckAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetLuckAt(t)
return uuo
}
// SetNillableLuckAt sets the "luck_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLuckAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetLuckAt(*t)
}
return uuo
}
// ClearLuckAt clears the value of the "luck_at" field.
func (uuo *UserUpdateOne) ClearLuckAt() *UserUpdateOne {
uuo.mutation.ClearLuckAt()
return uuo
}
// SetLike sets the "like" field.
func (uuo *UserUpdateOne) SetLike(i int) *UserUpdateOne {
uuo.mutation.ResetLike()
uuo.mutation.SetLike(i)
return uuo
}
// SetNillableLike sets the "like" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLike(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLike(*i)
}
return uuo
}
// AddLike adds i to the "like" field.
func (uuo *UserUpdateOne) AddLike(i int) *UserUpdateOne {
uuo.mutation.AddLike(i)
return uuo
}
// ClearLike clears the value of the "like" field.
func (uuo *UserUpdateOne) ClearLike() *UserUpdateOne {
uuo.mutation.ClearLike()
return uuo
}
// SetLikeRank sets the "like_rank" field.
func (uuo *UserUpdateOne) SetLikeRank(i int) *UserUpdateOne {
uuo.mutation.ResetLikeRank()
uuo.mutation.SetLikeRank(i)
return uuo
}
// SetNillableLikeRank sets the "like_rank" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLikeRank(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLikeRank(*i)
}
return uuo
}
// AddLikeRank adds i to the "like_rank" field.
func (uuo *UserUpdateOne) AddLikeRank(i int) *UserUpdateOne {
uuo.mutation.AddLikeRank(i)
return uuo
}
// ClearLikeRank clears the value of the "like_rank" field.
func (uuo *UserUpdateOne) ClearLikeRank() *UserUpdateOne {
uuo.mutation.ClearLikeRank()
return uuo
}
// SetLikeAt sets the "like_at" field.
func (uuo *UserUpdateOne) SetLikeAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetLikeAt(t)
return uuo
}
// SetNillableLikeAt sets the "like_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLikeAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetLikeAt(*t)
}
return uuo
}
// ClearLikeAt clears the value of the "like_at" field.
func (uuo *UserUpdateOne) ClearLikeAt() *UserUpdateOne {
uuo.mutation.ClearLikeAt()
return uuo
}
// SetFav sets the "fav" field.
func (uuo *UserUpdateOne) SetFav(i int) *UserUpdateOne {
uuo.mutation.ResetFav()
uuo.mutation.SetFav(i)
return uuo
}
// SetNillableFav sets the "fav" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableFav(i *int) *UserUpdateOne {
if i != nil {
uuo.SetFav(*i)
}
return uuo
}
// AddFav adds i to the "fav" field.
func (uuo *UserUpdateOne) AddFav(i int) *UserUpdateOne {
uuo.mutation.AddFav(i)
return uuo
}
// ClearFav clears the value of the "fav" field.
func (uuo *UserUpdateOne) ClearFav() *UserUpdateOne {
uuo.mutation.ClearFav()
return uuo
}
// SetTen sets the "ten" field.
func (uuo *UserUpdateOne) SetTen(b bool) *UserUpdateOne {
uuo.mutation.SetTen(b)
return uuo
}
// SetNillableTen sets the "ten" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTen(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetTen(*b)
}
return uuo
}
// ClearTen clears the value of the "ten" field.
func (uuo *UserUpdateOne) ClearTen() *UserUpdateOne {
uuo.mutation.ClearTen()
return uuo
}
// SetTenSu sets the "ten_su" field.
func (uuo *UserUpdateOne) SetTenSu(i int) *UserUpdateOne {
uuo.mutation.ResetTenSu()
uuo.mutation.SetTenSu(i)
return uuo
}
// SetNillableTenSu sets the "ten_su" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenSu(i *int) *UserUpdateOne {
if i != nil {
uuo.SetTenSu(*i)
}
return uuo
}
// AddTenSu adds i to the "ten_su" field.
func (uuo *UserUpdateOne) AddTenSu(i int) *UserUpdateOne {
uuo.mutation.AddTenSu(i)
return uuo
}
// ClearTenSu clears the value of the "ten_su" field.
func (uuo *UserUpdateOne) ClearTenSu() *UserUpdateOne {
uuo.mutation.ClearTenSu()
return uuo
}
// SetTenKai sets the "ten_kai" field.
func (uuo *UserUpdateOne) SetTenKai(i int) *UserUpdateOne {
uuo.mutation.ResetTenKai()
uuo.mutation.SetTenKai(i)
return uuo
}
// SetNillableTenKai sets the "ten_kai" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenKai(i *int) *UserUpdateOne {
if i != nil {
uuo.SetTenKai(*i)
}
return uuo
}
// AddTenKai adds i to the "ten_kai" field.
func (uuo *UserUpdateOne) AddTenKai(i int) *UserUpdateOne {
uuo.mutation.AddTenKai(i)
return uuo
}
// ClearTenKai clears the value of the "ten_kai" field.
func (uuo *UserUpdateOne) ClearTenKai() *UserUpdateOne {
uuo.mutation.ClearTenKai()
return uuo
}
// SetAiten sets the "aiten" field.
func (uuo *UserUpdateOne) SetAiten(i int) *UserUpdateOne {
uuo.mutation.ResetAiten()
uuo.mutation.SetAiten(i)
return uuo
}
// SetNillableAiten sets the "aiten" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableAiten(i *int) *UserUpdateOne {
if i != nil {
uuo.SetAiten(*i)
}
return uuo
}
// AddAiten adds i to the "aiten" field.
func (uuo *UserUpdateOne) AddAiten(i int) *UserUpdateOne {
uuo.mutation.AddAiten(i)
return uuo
}
// ClearAiten clears the value of the "aiten" field.
func (uuo *UserUpdateOne) ClearAiten() *UserUpdateOne {
uuo.mutation.ClearAiten()
return uuo
}
// SetTenCard sets the "ten_card" field.
func (uuo *UserUpdateOne) SetTenCard(s string) *UserUpdateOne {
uuo.mutation.SetTenCard(s)
return uuo
}
// SetNillableTenCard sets the "ten_card" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenCard(s *string) *UserUpdateOne {
if s != nil {
uuo.SetTenCard(*s)
}
return uuo
}
// ClearTenCard clears the value of the "ten_card" field.
func (uuo *UserUpdateOne) ClearTenCard() *UserUpdateOne {
uuo.mutation.ClearTenCard()
return uuo
}
// SetTenDelete sets the "ten_delete" field.
func (uuo *UserUpdateOne) SetTenDelete(s string) *UserUpdateOne {
uuo.mutation.SetTenDelete(s)
return uuo
}
// SetNillableTenDelete sets the "ten_delete" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenDelete(s *string) *UserUpdateOne {
if s != nil {
uuo.SetTenDelete(*s)
}
return uuo
}
// ClearTenDelete clears the value of the "ten_delete" field.
func (uuo *UserUpdateOne) ClearTenDelete() *UserUpdateOne {
uuo.mutation.ClearTenDelete()
return uuo
}
// SetTenPost sets the "ten_post" field.
func (uuo *UserUpdateOne) SetTenPost(s string) *UserUpdateOne {
uuo.mutation.SetTenPost(s)
return uuo
}
// SetNillableTenPost sets the "ten_post" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenPost(s *string) *UserUpdateOne {
if s != nil {
uuo.SetTenPost(*s)
}
return uuo
}
// ClearTenPost clears the value of the "ten_post" field.
func (uuo *UserUpdateOne) ClearTenPost() *UserUpdateOne {
uuo.mutation.ClearTenPost()
return uuo
}
// SetTenGet sets the "ten_get" field.
func (uuo *UserUpdateOne) SetTenGet(s string) *UserUpdateOne {
uuo.mutation.SetTenGet(s)
return uuo
}
// SetNillableTenGet sets the "ten_get" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenGet(s *string) *UserUpdateOne {
if s != nil {
uuo.SetTenGet(*s)
}
return uuo
}
// ClearTenGet clears the value of the "ten_get" field.
func (uuo *UserUpdateOne) ClearTenGet() *UserUpdateOne {
uuo.mutation.ClearTenGet()
return uuo
}
// SetTenAt sets the "ten_at" field.
func (uuo *UserUpdateOne) SetTenAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetTenAt(t)
return uuo
}
// SetNillableTenAt sets the "ten_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableTenAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetTenAt(*t)
}
return uuo
}
// ClearTenAt clears the value of the "ten_at" field.
func (uuo *UserUpdateOne) ClearTenAt() *UserUpdateOne {
uuo.mutation.ClearTenAt()
return uuo
}
// SetNext sets the "next" field.
func (uuo *UserUpdateOne) SetNext(s string) *UserUpdateOne {
uuo.mutation.SetNext(s)
return uuo
}
// SetNillableNext sets the "next" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableNext(s *string) *UserUpdateOne {
if s != nil {
uuo.SetNext(*s)
}
return uuo
}
// ClearNext clears the value of the "next" field.
func (uuo *UserUpdateOne) ClearNext() *UserUpdateOne {
uuo.mutation.ClearNext()
return uuo
}
// SetRoom sets the "room" field.
func (uuo *UserUpdateOne) SetRoom(i int) *UserUpdateOne {
uuo.mutation.ResetRoom()
uuo.mutation.SetRoom(i)
return uuo
}
// SetNillableRoom sets the "room" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableRoom(i *int) *UserUpdateOne {
if i != nil {
uuo.SetRoom(*i)
}
return uuo
}
// AddRoom adds i to the "room" field.
func (uuo *UserUpdateOne) AddRoom(i int) *UserUpdateOne {
uuo.mutation.AddRoom(i)
return uuo
}
// ClearRoom clears the value of the "room" field.
func (uuo *UserUpdateOne) ClearRoom() *UserUpdateOne {
uuo.mutation.ClearRoom()
return uuo
}
// SetModel sets the "model" field.
func (uuo *UserUpdateOne) SetModel(b bool) *UserUpdateOne {
uuo.mutation.SetModel(b)
return uuo
}
// SetNillableModel sets the "model" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModel(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetModel(*b)
}
return uuo
}
// ClearModel clears the value of the "model" field.
func (uuo *UserUpdateOne) ClearModel() *UserUpdateOne {
uuo.mutation.ClearModel()
return uuo
}
// SetModelAt sets the "model_at" field.
func (uuo *UserUpdateOne) SetModelAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetModelAt(t)
return uuo
}
// SetNillableModelAt sets the "model_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetModelAt(*t)
}
return uuo
}
// ClearModelAt clears the value of the "model_at" field.
func (uuo *UserUpdateOne) ClearModelAt() *UserUpdateOne {
uuo.mutation.ClearModelAt()
return uuo
}
// SetModelAttack sets the "model_attack" field.
func (uuo *UserUpdateOne) SetModelAttack(i int) *UserUpdateOne {
uuo.mutation.ResetModelAttack()
uuo.mutation.SetModelAttack(i)
return uuo
}
// SetNillableModelAttack sets the "model_attack" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelAttack(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelAttack(*i)
}
return uuo
}
// AddModelAttack adds i to the "model_attack" field.
func (uuo *UserUpdateOne) AddModelAttack(i int) *UserUpdateOne {
uuo.mutation.AddModelAttack(i)
return uuo
}
// ClearModelAttack clears the value of the "model_attack" field.
func (uuo *UserUpdateOne) ClearModelAttack() *UserUpdateOne {
uuo.mutation.ClearModelAttack()
return uuo
}
// SetModelLimit sets the "model_limit" field.
func (uuo *UserUpdateOne) SetModelLimit(i int) *UserUpdateOne {
uuo.mutation.ResetModelLimit()
uuo.mutation.SetModelLimit(i)
return uuo
}
// SetNillableModelLimit sets the "model_limit" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelLimit(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelLimit(*i)
}
return uuo
}
// AddModelLimit adds i to the "model_limit" field.
func (uuo *UserUpdateOne) AddModelLimit(i int) *UserUpdateOne {
uuo.mutation.AddModelLimit(i)
return uuo
}
// ClearModelLimit clears the value of the "model_limit" field.
func (uuo *UserUpdateOne) ClearModelLimit() *UserUpdateOne {
uuo.mutation.ClearModelLimit()
return uuo
}
// SetModelSkill sets the "model_skill" field.
func (uuo *UserUpdateOne) SetModelSkill(i int) *UserUpdateOne {
uuo.mutation.ResetModelSkill()
uuo.mutation.SetModelSkill(i)
return uuo
}
// SetNillableModelSkill sets the "model_skill" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelSkill(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelSkill(*i)
}
return uuo
}
// AddModelSkill adds i to the "model_skill" field.
func (uuo *UserUpdateOne) AddModelSkill(i int) *UserUpdateOne {
uuo.mutation.AddModelSkill(i)
return uuo
}
// ClearModelSkill clears the value of the "model_skill" field.
func (uuo *UserUpdateOne) ClearModelSkill() *UserUpdateOne {
uuo.mutation.ClearModelSkill()
return uuo
}
// SetModelMode sets the "model_mode" field.
func (uuo *UserUpdateOne) SetModelMode(i int) *UserUpdateOne {
uuo.mutation.ResetModelMode()
uuo.mutation.SetModelMode(i)
return uuo
}
// SetNillableModelMode sets the "model_mode" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelMode(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelMode(*i)
}
return uuo
}
// AddModelMode adds i to the "model_mode" field.
func (uuo *UserUpdateOne) AddModelMode(i int) *UserUpdateOne {
uuo.mutation.AddModelMode(i)
return uuo
}
// ClearModelMode clears the value of the "model_mode" field.
func (uuo *UserUpdateOne) ClearModelMode() *UserUpdateOne {
uuo.mutation.ClearModelMode()
return uuo
}
// SetModelCritical sets the "model_critical" field.
func (uuo *UserUpdateOne) SetModelCritical(i int) *UserUpdateOne {
uuo.mutation.ResetModelCritical()
uuo.mutation.SetModelCritical(i)
return uuo
}
// SetNillableModelCritical sets the "model_critical" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelCritical(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelCritical(*i)
}
return uuo
}
// AddModelCritical adds i to the "model_critical" field.
func (uuo *UserUpdateOne) AddModelCritical(i int) *UserUpdateOne {
uuo.mutation.AddModelCritical(i)
return uuo
}
// ClearModelCritical clears the value of the "model_critical" field.
func (uuo *UserUpdateOne) ClearModelCritical() *UserUpdateOne {
uuo.mutation.ClearModelCritical()
return uuo
}
// SetModelCriticalD sets the "model_critical_d" field.
func (uuo *UserUpdateOne) SetModelCriticalD(i int) *UserUpdateOne {
uuo.mutation.ResetModelCriticalD()
uuo.mutation.SetModelCriticalD(i)
return uuo
}
// SetNillableModelCriticalD sets the "model_critical_d" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableModelCriticalD(i *int) *UserUpdateOne {
if i != nil {
uuo.SetModelCriticalD(*i)
}
return uuo
}
// AddModelCriticalD adds i to the "model_critical_d" field.
func (uuo *UserUpdateOne) AddModelCriticalD(i int) *UserUpdateOne {
uuo.mutation.AddModelCriticalD(i)
return uuo
}
// ClearModelCriticalD clears the value of the "model_critical_d" field.
func (uuo *UserUpdateOne) ClearModelCriticalD() *UserUpdateOne {
uuo.mutation.ClearModelCriticalD()
return uuo
}
// SetGame sets the "game" field.
func (uuo *UserUpdateOne) SetGame(b bool) *UserUpdateOne {
uuo.mutation.SetGame(b)
return uuo
}
// SetNillableGame sets the "game" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGame(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGame(*b)
}
return uuo
}
// ClearGame clears the value of the "game" field.
func (uuo *UserUpdateOne) ClearGame() *UserUpdateOne {
uuo.mutation.ClearGame()
return uuo
}
// SetGameTest sets the "game_test" field.
func (uuo *UserUpdateOne) SetGameTest(b bool) *UserUpdateOne {
uuo.mutation.SetGameTest(b)
return uuo
}
// SetNillableGameTest sets the "game_test" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameTest(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGameTest(*b)
}
return uuo
}
// ClearGameTest clears the value of the "game_test" field.
func (uuo *UserUpdateOne) ClearGameTest() *UserUpdateOne {
uuo.mutation.ClearGameTest()
return uuo
}
// SetGameEnd sets the "game_end" field.
func (uuo *UserUpdateOne) SetGameEnd(b bool) *UserUpdateOne {
uuo.mutation.SetGameEnd(b)
return uuo
}
// SetNillableGameEnd sets the "game_end" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameEnd(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGameEnd(*b)
}
return uuo
}
// ClearGameEnd clears the value of the "game_end" field.
func (uuo *UserUpdateOne) ClearGameEnd() *UserUpdateOne {
uuo.mutation.ClearGameEnd()
return uuo
}
// SetGameAccount sets the "game_account" field.
func (uuo *UserUpdateOne) SetGameAccount(b bool) *UserUpdateOne {
uuo.mutation.SetGameAccount(b)
return uuo
}
// SetNillableGameAccount sets the "game_account" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameAccount(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGameAccount(*b)
}
return uuo
}
// ClearGameAccount clears the value of the "game_account" field.
func (uuo *UserUpdateOne) ClearGameAccount() *UserUpdateOne {
uuo.mutation.ClearGameAccount()
return uuo
}
// SetGameLv sets the "game_lv" field.
func (uuo *UserUpdateOne) SetGameLv(i int) *UserUpdateOne {
uuo.mutation.ResetGameLv()
uuo.mutation.SetGameLv(i)
return uuo
}
// SetNillableGameLv sets the "game_lv" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameLv(i *int) *UserUpdateOne {
if i != nil {
uuo.SetGameLv(*i)
}
return uuo
}
// AddGameLv adds i to the "game_lv" field.
func (uuo *UserUpdateOne) AddGameLv(i int) *UserUpdateOne {
uuo.mutation.AddGameLv(i)
return uuo
}
// ClearGameLv clears the value of the "game_lv" field.
func (uuo *UserUpdateOne) ClearGameLv() *UserUpdateOne {
uuo.mutation.ClearGameLv()
return uuo
}
// SetGameExp sets the "game_exp" field.
func (uuo *UserUpdateOne) SetGameExp(i int) *UserUpdateOne {
uuo.mutation.ResetGameExp()
uuo.mutation.SetGameExp(i)
return uuo
}
// SetNillableGameExp sets the "game_exp" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameExp(i *int) *UserUpdateOne {
if i != nil {
uuo.SetGameExp(*i)
}
return uuo
}
// AddGameExp adds i to the "game_exp" field.
func (uuo *UserUpdateOne) AddGameExp(i int) *UserUpdateOne {
uuo.mutation.AddGameExp(i)
return uuo
}
// ClearGameExp clears the value of the "game_exp" field.
func (uuo *UserUpdateOne) ClearGameExp() *UserUpdateOne {
uuo.mutation.ClearGameExp()
return uuo
}
// SetGameStory sets the "game_story" field.
func (uuo *UserUpdateOne) SetGameStory(i int) *UserUpdateOne {
uuo.mutation.ResetGameStory()
uuo.mutation.SetGameStory(i)
return uuo
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameStory(i *int) *UserUpdateOne {
if i != nil {
uuo.SetGameStory(*i)
}
return uuo
}
// AddGameStory adds i to the "game_story" field.
func (uuo *UserUpdateOne) AddGameStory(i int) *UserUpdateOne {
uuo.mutation.AddGameStory(i)
return uuo
}
// ClearGameStory clears the value of the "game_story" field.
func (uuo *UserUpdateOne) ClearGameStory() *UserUpdateOne {
uuo.mutation.ClearGameStory()
return uuo
}
// SetGameLimit sets the "game_limit" field.
func (uuo *UserUpdateOne) SetGameLimit(b bool) *UserUpdateOne {
uuo.mutation.SetGameLimit(b)
return uuo
}
// SetNillableGameLimit sets the "game_limit" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameLimit(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGameLimit(*b)
}
return uuo
}
// ClearGameLimit clears the value of the "game_limit" field.
func (uuo *UserUpdateOne) ClearGameLimit() *UserUpdateOne {
uuo.mutation.ClearGameLimit()
return uuo
}
// SetCoin sets the "coin" field.
func (uuo *UserUpdateOne) SetCoin(i int) *UserUpdateOne {
uuo.mutation.ResetCoin()
uuo.mutation.SetCoin(i)
return uuo
}
// SetNillableCoin sets the "coin" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableCoin(i *int) *UserUpdateOne {
if i != nil {
uuo.SetCoin(*i)
}
return uuo
}
// AddCoin adds i to the "coin" field.
func (uuo *UserUpdateOne) AddCoin(i int) *UserUpdateOne {
uuo.mutation.AddCoin(i)
return uuo
}
// ClearCoin clears the value of the "coin" field.
func (uuo *UserUpdateOne) ClearCoin() *UserUpdateOne {
uuo.mutation.ClearCoin()
return uuo
}
// SetCoinOpen sets the "coin_open" field.
func (uuo *UserUpdateOne) SetCoinOpen(b bool) *UserUpdateOne {
uuo.mutation.SetCoinOpen(b)
return uuo
}
// SetNillableCoinOpen sets the "coin_open" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableCoinOpen(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetCoinOpen(*b)
}
return uuo
}
// ClearCoinOpen clears the value of the "coin_open" field.
func (uuo *UserUpdateOne) ClearCoinOpen() *UserUpdateOne {
uuo.mutation.ClearCoinOpen()
return uuo
}
// SetCoinAt sets the "coin_at" field.
func (uuo *UserUpdateOne) SetCoinAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetCoinAt(t)
return uuo
}
// SetNillableCoinAt sets the "coin_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableCoinAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetCoinAt(*t)
}
return uuo
}
// ClearCoinAt clears the value of the "coin_at" field.
func (uuo *UserUpdateOne) ClearCoinAt() *UserUpdateOne {
uuo.mutation.ClearCoinAt()
return uuo
}
// AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddCardIDs(ids...)
return uuo
}
// AddCard adds the "card" edges to the Card entity.
func (uuo *UserUpdateOne) AddCard(c ...*Card) *UserUpdateOne {
ids := make([]int, len(c))
for i := range c {
ids[i] = c[i].ID
}
return uuo.AddCardIDs(ids...)
}
// AddUeIDs adds the "ue" edge to the Ue entity by IDs.
func (uuo *UserUpdateOne) AddUeIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddUeIDs(ids...)
return uuo
}
// AddUe adds the "ue" edges to the Ue entity.
func (uuo *UserUpdateOne) AddUe(u ...*Ue) *UserUpdateOne {
ids := make([]int, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uuo.AddUeIDs(ids...)
}
// AddMaIDs adds the "ma" edge to the Ma entity by IDs.
func (uuo *UserUpdateOne) AddMaIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddMaIDs(ids...)
return uuo
}
// AddMa adds the "ma" edges to the Ma entity.
func (uuo *UserUpdateOne) AddMa(m ...*Ma) *UserUpdateOne {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return uuo.AddMaIDs(ids...)
}
// AddSevIDs adds the "sev" edge to the Sev entity by IDs.
func (uuo *UserUpdateOne) AddSevIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddSevIDs(ids...)
return uuo
}
// AddSev adds the "sev" edges to the Sev entity.
func (uuo *UserUpdateOne) AddSev(s ...*Sev) *UserUpdateOne {
ids := make([]int, len(s))
for i := range s {
ids[i] = s[i].ID
}
return uuo.AddSevIDs(ids...)
}
// Mutation returns the UserMutation object of the builder.
func (uuo *UserUpdateOne) Mutation() *UserMutation {
return uuo.mutation
}
// ClearCard clears all "card" edges to the Card entity.
func (uuo *UserUpdateOne) ClearCard() *UserUpdateOne {
uuo.mutation.ClearCard()
return uuo
}
// RemoveCardIDs removes the "card" edge to Card entities by IDs.
func (uuo *UserUpdateOne) RemoveCardIDs(ids ...int) *UserUpdateOne {
uuo.mutation.RemoveCardIDs(ids...)
return uuo
}
// RemoveCard removes "card" edges to Card entities.
func (uuo *UserUpdateOne) RemoveCard(c ...*Card) *UserUpdateOne {
ids := make([]int, len(c))
for i := range c {
ids[i] = c[i].ID
}
return uuo.RemoveCardIDs(ids...)
}
// ClearUe clears all "ue" edges to the Ue entity.
func (uuo *UserUpdateOne) ClearUe() *UserUpdateOne {
uuo.mutation.ClearUe()
return uuo
}
// RemoveUeIDs removes the "ue" edge to Ue entities by IDs.
func (uuo *UserUpdateOne) RemoveUeIDs(ids ...int) *UserUpdateOne {
uuo.mutation.RemoveUeIDs(ids...)
return uuo
}
// RemoveUe removes "ue" edges to Ue entities.
func (uuo *UserUpdateOne) RemoveUe(u ...*Ue) *UserUpdateOne {
ids := make([]int, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uuo.RemoveUeIDs(ids...)
}
// ClearMa clears all "ma" edges to the Ma entity.
func (uuo *UserUpdateOne) ClearMa() *UserUpdateOne {
uuo.mutation.ClearMa()
return uuo
}
// RemoveMaIDs removes the "ma" edge to Ma entities by IDs.
func (uuo *UserUpdateOne) RemoveMaIDs(ids ...int) *UserUpdateOne {
uuo.mutation.RemoveMaIDs(ids...)
return uuo
}
// RemoveMa removes "ma" edges to Ma entities.
func (uuo *UserUpdateOne) RemoveMa(m ...*Ma) *UserUpdateOne {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return uuo.RemoveMaIDs(ids...)
}
// ClearSev clears all "sev" edges to the Sev entity.
func (uuo *UserUpdateOne) ClearSev() *UserUpdateOne {
uuo.mutation.ClearSev()
return uuo
}
// RemoveSevIDs removes the "sev" edge to Sev entities by IDs.
func (uuo *UserUpdateOne) RemoveSevIDs(ids ...int) *UserUpdateOne {
uuo.mutation.RemoveSevIDs(ids...)
return uuo
}
// RemoveSev removes "sev" edges to Sev entities.
func (uuo *UserUpdateOne) RemoveSev(s ...*Sev) *UserUpdateOne {
ids := make([]int, len(s))
for i := range s {
ids[i] = s[i].ID
}
return uuo.RemoveSevIDs(ids...)
}
// Where appends a list predicates to the UserUpdate builder.
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne {
uuo.mutation.Where(ps...)
return uuo
}
// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne {
uuo.fields = append([]string{field}, fields...)
return uuo
}
// Save executes the query and returns the updated User entity.
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) {
return withHooks[*User, UserMutation](ctx, uuo.sqlSave, uuo.mutation, uuo.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User {
node, err := uuo.Save(ctx)
if err != nil {
panic(err)
}
return node
}
// Exec executes the query on the entity.
func (uuo *UserUpdateOne) Exec(ctx context.Context) error {
_, err := uuo.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uuo *UserUpdateOne) ExecX(ctx context.Context) {
if err := uuo.Exec(ctx); err != nil {
panic(err)
}
}
func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) {
_spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt))
id, ok := uuo.mutation.ID()
if !ok {
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "User.id" for update`)}
}
_spec.Node.ID.Value = id
if fields := uuo.fields; len(fields) > 0 {
_spec.Node.Columns = make([]string, 0, len(fields))
_spec.Node.Columns = append(_spec.Node.Columns, user.FieldID)
for _, f := range fields {
if !user.ValidColumn(f) {
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
}
if f != user.FieldID {
_spec.Node.Columns = append(_spec.Node.Columns, f)
}
}
}
if ps := uuo.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := uuo.mutation.Did(); ok {
_spec.SetField(user.FieldDid, field.TypeString, value)
}
if uuo.mutation.DidCleared() {
_spec.ClearField(user.FieldDid, field.TypeString)
}
if value, ok := uuo.mutation.Member(); ok {
_spec.SetField(user.FieldMember, field.TypeBool, value)
}
if uuo.mutation.MemberCleared() {
_spec.ClearField(user.FieldMember, field.TypeBool)
}
if value, ok := uuo.mutation.Book(); ok {
_spec.SetField(user.FieldBook, field.TypeBool, value)
}
if uuo.mutation.BookCleared() {
_spec.ClearField(user.FieldBook, field.TypeBool)
}
if value, ok := uuo.mutation.Manga(); ok {
_spec.SetField(user.FieldManga, field.TypeBool, value)
}
if uuo.mutation.MangaCleared() {
_spec.ClearField(user.FieldManga, field.TypeBool)
}
if value, ok := uuo.mutation.Badge(); ok {
_spec.SetField(user.FieldBadge, field.TypeBool, value)
}
if uuo.mutation.BadgeCleared() {
_spec.ClearField(user.FieldBadge, field.TypeBool)
}
if value, ok := uuo.mutation.Bsky(); ok {
_spec.SetField(user.FieldBsky, field.TypeBool, value)
}
if uuo.mutation.BskyCleared() {
_spec.ClearField(user.FieldBsky, field.TypeBool)
}
if value, ok := uuo.mutation.Mastodon(); ok {
_spec.SetField(user.FieldMastodon, field.TypeBool, value)
}
if uuo.mutation.MastodonCleared() {
_spec.ClearField(user.FieldMastodon, field.TypeBool)
}
if value, ok := uuo.mutation.Delete(); ok {
_spec.SetField(user.FieldDelete, field.TypeBool, value)
}
if uuo.mutation.DeleteCleared() {
_spec.ClearField(user.FieldDelete, field.TypeBool)
}
if value, ok := uuo.mutation.Handle(); ok {
_spec.SetField(user.FieldHandle, field.TypeBool, value)
}
if uuo.mutation.HandleCleared() {
_spec.ClearField(user.FieldHandle, field.TypeBool)
}
if value, ok := uuo.mutation.Token(); ok {
_spec.SetField(user.FieldToken, field.TypeString, value)
}
if uuo.mutation.TokenCleared() {
_spec.ClearField(user.FieldToken, field.TypeString)
}
if uuo.mutation.CreatedAtCleared() {
_spec.ClearField(user.FieldCreatedAt, field.TypeTime)
}
if value, ok := uuo.mutation.UpdatedAt(); ok {
_spec.SetField(user.FieldUpdatedAt, field.TypeTime, value)
}
if uuo.mutation.UpdatedAtCleared() {
_spec.ClearField(user.FieldUpdatedAt, field.TypeTime)
}
if value, ok := uuo.mutation.RaidAt(); ok {
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
}
if uuo.mutation.RaidAtCleared() {
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
}
if value, ok := uuo.mutation.ServerAt(); ok {
_spec.SetField(user.FieldServerAt, field.TypeTime, value)
}
if uuo.mutation.ServerAtCleared() {
_spec.ClearField(user.FieldServerAt, field.TypeTime)
}
if value, ok := uuo.mutation.EggAt(); ok {
_spec.SetField(user.FieldEggAt, field.TypeTime, value)
}
if uuo.mutation.EggAtCleared() {
_spec.ClearField(user.FieldEggAt, field.TypeTime)
}
if value, ok := uuo.mutation.Luck(); ok {
_spec.SetField(user.FieldLuck, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLuck(); ok {
_spec.AddField(user.FieldLuck, field.TypeInt, value)
}
if uuo.mutation.LuckCleared() {
_spec.ClearField(user.FieldLuck, field.TypeInt)
}
if value, ok := uuo.mutation.LuckAt(); ok {
_spec.SetField(user.FieldLuckAt, field.TypeTime, value)
}
if uuo.mutation.LuckAtCleared() {
_spec.ClearField(user.FieldLuckAt, field.TypeTime)
}
if value, ok := uuo.mutation.Like(); ok {
_spec.SetField(user.FieldLike, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLike(); ok {
_spec.AddField(user.FieldLike, field.TypeInt, value)
}
if uuo.mutation.LikeCleared() {
_spec.ClearField(user.FieldLike, field.TypeInt)
}
if value, ok := uuo.mutation.LikeRank(); ok {
_spec.SetField(user.FieldLikeRank, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLikeRank(); ok {
_spec.AddField(user.FieldLikeRank, field.TypeInt, value)
}
if uuo.mutation.LikeRankCleared() {
_spec.ClearField(user.FieldLikeRank, field.TypeInt)
}
if value, ok := uuo.mutation.LikeAt(); ok {
_spec.SetField(user.FieldLikeAt, field.TypeTime, value)
}
if uuo.mutation.LikeAtCleared() {
_spec.ClearField(user.FieldLikeAt, field.TypeTime)
}
if value, ok := uuo.mutation.Fav(); ok {
_spec.SetField(user.FieldFav, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedFav(); ok {
_spec.AddField(user.FieldFav, field.TypeInt, value)
}
if uuo.mutation.FavCleared() {
_spec.ClearField(user.FieldFav, field.TypeInt)
}
if value, ok := uuo.mutation.Ten(); ok {
_spec.SetField(user.FieldTen, field.TypeBool, value)
}
if uuo.mutation.TenCleared() {
_spec.ClearField(user.FieldTen, field.TypeBool)
}
if value, ok := uuo.mutation.TenSu(); ok {
_spec.SetField(user.FieldTenSu, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedTenSu(); ok {
_spec.AddField(user.FieldTenSu, field.TypeInt, value)
}
if uuo.mutation.TenSuCleared() {
_spec.ClearField(user.FieldTenSu, field.TypeInt)
}
if value, ok := uuo.mutation.TenKai(); ok {
_spec.SetField(user.FieldTenKai, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedTenKai(); ok {
_spec.AddField(user.FieldTenKai, field.TypeInt, value)
}
if uuo.mutation.TenKaiCleared() {
_spec.ClearField(user.FieldTenKai, field.TypeInt)
}
if value, ok := uuo.mutation.Aiten(); ok {
_spec.SetField(user.FieldAiten, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedAiten(); ok {
_spec.AddField(user.FieldAiten, field.TypeInt, value)
}
if uuo.mutation.AitenCleared() {
_spec.ClearField(user.FieldAiten, field.TypeInt)
}
if value, ok := uuo.mutation.TenCard(); ok {
_spec.SetField(user.FieldTenCard, field.TypeString, value)
}
if uuo.mutation.TenCardCleared() {
_spec.ClearField(user.FieldTenCard, field.TypeString)
}
if value, ok := uuo.mutation.TenDelete(); ok {
_spec.SetField(user.FieldTenDelete, field.TypeString, value)
}
if uuo.mutation.TenDeleteCleared() {
_spec.ClearField(user.FieldTenDelete, field.TypeString)
}
if value, ok := uuo.mutation.TenPost(); ok {
_spec.SetField(user.FieldTenPost, field.TypeString, value)
}
if uuo.mutation.TenPostCleared() {
_spec.ClearField(user.FieldTenPost, field.TypeString)
}
if value, ok := uuo.mutation.TenGet(); ok {
_spec.SetField(user.FieldTenGet, field.TypeString, value)
}
if uuo.mutation.TenGetCleared() {
_spec.ClearField(user.FieldTenGet, field.TypeString)
}
if value, ok := uuo.mutation.TenAt(); ok {
_spec.SetField(user.FieldTenAt, field.TypeTime, value)
}
if uuo.mutation.TenAtCleared() {
_spec.ClearField(user.FieldTenAt, field.TypeTime)
}
if value, ok := uuo.mutation.Next(); ok {
_spec.SetField(user.FieldNext, field.TypeString, value)
}
if uuo.mutation.NextCleared() {
_spec.ClearField(user.FieldNext, field.TypeString)
}
if value, ok := uuo.mutation.Room(); ok {
_spec.SetField(user.FieldRoom, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedRoom(); ok {
_spec.AddField(user.FieldRoom, field.TypeInt, value)
}
if uuo.mutation.RoomCleared() {
_spec.ClearField(user.FieldRoom, field.TypeInt)
}
if value, ok := uuo.mutation.Model(); ok {
_spec.SetField(user.FieldModel, field.TypeBool, value)
}
if uuo.mutation.ModelCleared() {
_spec.ClearField(user.FieldModel, field.TypeBool)
}
if value, ok := uuo.mutation.ModelAt(); ok {
_spec.SetField(user.FieldModelAt, field.TypeTime, value)
}
if uuo.mutation.ModelAtCleared() {
_spec.ClearField(user.FieldModelAt, field.TypeTime)
}
if value, ok := uuo.mutation.ModelAttack(); ok {
_spec.SetField(user.FieldModelAttack, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelAttack(); ok {
_spec.AddField(user.FieldModelAttack, field.TypeInt, value)
}
if uuo.mutation.ModelAttackCleared() {
_spec.ClearField(user.FieldModelAttack, field.TypeInt)
}
if value, ok := uuo.mutation.ModelLimit(); ok {
_spec.SetField(user.FieldModelLimit, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelLimit(); ok {
_spec.AddField(user.FieldModelLimit, field.TypeInt, value)
}
if uuo.mutation.ModelLimitCleared() {
_spec.ClearField(user.FieldModelLimit, field.TypeInt)
}
if value, ok := uuo.mutation.ModelSkill(); ok {
_spec.SetField(user.FieldModelSkill, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelSkill(); ok {
_spec.AddField(user.FieldModelSkill, field.TypeInt, value)
}
if uuo.mutation.ModelSkillCleared() {
_spec.ClearField(user.FieldModelSkill, field.TypeInt)
}
if value, ok := uuo.mutation.ModelMode(); ok {
_spec.SetField(user.FieldModelMode, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelMode(); ok {
_spec.AddField(user.FieldModelMode, field.TypeInt, value)
}
if uuo.mutation.ModelModeCleared() {
_spec.ClearField(user.FieldModelMode, field.TypeInt)
}
if value, ok := uuo.mutation.ModelCritical(); ok {
_spec.SetField(user.FieldModelCritical, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelCritical(); ok {
_spec.AddField(user.FieldModelCritical, field.TypeInt, value)
}
if uuo.mutation.ModelCriticalCleared() {
_spec.ClearField(user.FieldModelCritical, field.TypeInt)
}
if value, ok := uuo.mutation.ModelCriticalD(); ok {
_spec.SetField(user.FieldModelCriticalD, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedModelCriticalD(); ok {
_spec.AddField(user.FieldModelCriticalD, field.TypeInt, value)
}
if uuo.mutation.ModelCriticalDCleared() {
_spec.ClearField(user.FieldModelCriticalD, field.TypeInt)
}
if value, ok := uuo.mutation.Game(); ok {
_spec.SetField(user.FieldGame, field.TypeBool, value)
}
if uuo.mutation.GameCleared() {
_spec.ClearField(user.FieldGame, field.TypeBool)
}
if value, ok := uuo.mutation.GameTest(); ok {
_spec.SetField(user.FieldGameTest, field.TypeBool, value)
}
if uuo.mutation.GameTestCleared() {
_spec.ClearField(user.FieldGameTest, field.TypeBool)
}
if value, ok := uuo.mutation.GameEnd(); ok {
_spec.SetField(user.FieldGameEnd, field.TypeBool, value)
}
if uuo.mutation.GameEndCleared() {
_spec.ClearField(user.FieldGameEnd, field.TypeBool)
}
if value, ok := uuo.mutation.GameAccount(); ok {
_spec.SetField(user.FieldGameAccount, field.TypeBool, value)
}
if uuo.mutation.GameAccountCleared() {
_spec.ClearField(user.FieldGameAccount, field.TypeBool)
}
if value, ok := uuo.mutation.GameLv(); ok {
_spec.SetField(user.FieldGameLv, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameLv(); ok {
_spec.AddField(user.FieldGameLv, field.TypeInt, value)
}
if uuo.mutation.GameLvCleared() {
_spec.ClearField(user.FieldGameLv, field.TypeInt)
}
if value, ok := uuo.mutation.GameExp(); ok {
_spec.SetField(user.FieldGameExp, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameExp(); ok {
_spec.AddField(user.FieldGameExp, field.TypeInt, value)
}
if uuo.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uuo.mutation.GameStory(); ok {
_spec.SetField(user.FieldGameStory, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameStory(); ok {
_spec.AddField(user.FieldGameStory, field.TypeInt, value)
}
if uuo.mutation.GameStoryCleared() {
_spec.ClearField(user.FieldGameStory, field.TypeInt)
}
if value, ok := uuo.mutation.GameLimit(); ok {
_spec.SetField(user.FieldGameLimit, field.TypeBool, value)
}
if uuo.mutation.GameLimitCleared() {
_spec.ClearField(user.FieldGameLimit, field.TypeBool)
}
if value, ok := uuo.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedCoin(); ok {
_spec.AddField(user.FieldCoin, field.TypeInt, value)
}
if uuo.mutation.CoinCleared() {
_spec.ClearField(user.FieldCoin, field.TypeInt)
}
if value, ok := uuo.mutation.CoinOpen(); ok {
_spec.SetField(user.FieldCoinOpen, field.TypeBool, value)
}
if uuo.mutation.CoinOpenCleared() {
_spec.ClearField(user.FieldCoinOpen, field.TypeBool)
}
if value, ok := uuo.mutation.CoinAt(); ok {
_spec.SetField(user.FieldCoinAt, field.TypeTime, value)
}
if uuo.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
}
if uuo.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.RemovedCardIDs(); len(nodes) > 0 && !uuo.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.CardIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.CardTable,
Columns: []string{user.CardColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(card.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uuo.mutation.UeCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.RemovedUeIDs(); len(nodes) > 0 && !uuo.mutation.UeCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.UeIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.UeTable,
Columns: []string{user.UeColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ue.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uuo.mutation.MaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.RemovedMaIDs(); len(nodes) > 0 && !uuo.mutation.MaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.MaIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.MaTable,
Columns: []string{user.MaColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(ma.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if uuo.mutation.SevCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.RemovedSevIDs(); len(nodes) > 0 && !uuo.mutation.SevCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.SevIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.SevTable,
Columns: []string{user.SevColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
_node = &User{config: uuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues
if err = sqlgraph.UpdateNode(ctx, uuo.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{user.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
uuo.mutation.done = true
return _node, nil
}