1
0
This commit is contained in:
syui 2024-06-08 01:09:55 +09:00
parent e707b1802e
commit db13d9689e
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
10 changed files with 102 additions and 131 deletions

View File

@ -153,7 +153,7 @@ var (
{Name: "game_lv", Type: field.TypeString, Nullable: true},
{Name: "game_exp", Type: field.TypeString, Nullable: true},
{Name: "game_id", Type: field.TypeString, Nullable: true},
{Name: "game_story", Type: field.TypeInt, Nullable: true},
{Name: "game_story", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeTime, Nullable: true},
{Name: "user_ue", Type: field.TypeInt},
}

View File

@ -5117,8 +5117,7 @@ type UeMutation struct {
game_lv *string
game_exp *string
game_id *string
game_story *int
addgame_story *int
game_story *string
created_at *time.Time
clearedFields map[string]struct{}
owner *int
@ -6474,13 +6473,12 @@ func (m *UeMutation) ResetGameID() {
}
// SetGameStory sets the "game_story" field.
func (m *UeMutation) SetGameStory(i int) {
m.game_story = &i
m.addgame_story = nil
func (m *UeMutation) SetGameStory(s string) {
m.game_story = &s
}
// GameStory returns the value of the "game_story" field in the mutation.
func (m *UeMutation) GameStory() (r int, exists bool) {
func (m *UeMutation) GameStory() (r string, exists bool) {
v := m.game_story
if v == nil {
return
@ -6491,7 +6489,7 @@ func (m *UeMutation) GameStory() (r int, exists bool) {
// OldGameStory returns the old "game_story" field's value of the Ue entity.
// If the Ue object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *UeMutation) OldGameStory(ctx context.Context) (v int, err error) {
func (m *UeMutation) OldGameStory(ctx context.Context) (v string, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldGameStory is only allowed on UpdateOne operations")
}
@ -6505,28 +6503,9 @@ func (m *UeMutation) OldGameStory(ctx context.Context) (v int, err error) {
return oldValue.GameStory, nil
}
// AddGameStory adds i to the "game_story" field.
func (m *UeMutation) AddGameStory(i int) {
if m.addgame_story != nil {
*m.addgame_story += i
} else {
m.addgame_story = &i
}
}
// AddedGameStory returns the value that was added to the "game_story" field in this mutation.
func (m *UeMutation) AddedGameStory() (r int, exists bool) {
v := m.addgame_story
if v == nil {
return
}
return *v, true
}
// ClearGameStory clears the value of the "game_story" field.
func (m *UeMutation) ClearGameStory() {
m.game_story = nil
m.addgame_story = nil
m.clearedFields[ue.FieldGameStory] = struct{}{}
}
@ -6539,7 +6518,6 @@ func (m *UeMutation) GameStoryCleared() bool {
// ResetGameStory resets all changes to the "game_story" field.
func (m *UeMutation) ResetGameStory() {
m.game_story = nil
m.addgame_story = nil
delete(m.clearedFields, ue.FieldGameStory)
}
@ -7001,7 +6979,7 @@ func (m *UeMutation) SetField(name string, value ent.Value) error {
m.SetGameID(v)
return nil
case ue.FieldGameStory:
v, ok := value.(int)
v, ok := value.(string)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
@ -7055,9 +7033,6 @@ func (m *UeMutation) AddedFields() []string {
if m.addlocation_n != nil {
fields = append(fields, ue.FieldLocationN)
}
if m.addgame_story != nil {
fields = append(fields, ue.FieldGameStory)
}
return fields
}
@ -7088,8 +7063,6 @@ func (m *UeMutation) AddedField(name string) (ent.Value, bool) {
return m.AddedLocationZ()
case ue.FieldLocationN:
return m.AddedLocationN()
case ue.FieldGameStory:
return m.AddedGameStory()
}
return nil, false
}
@ -7176,13 +7149,6 @@ func (m *UeMutation) AddField(name string, value ent.Value) error {
}
m.AddLocationN(v)
return nil
case ue.FieldGameStory:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.AddGameStory(v)
return nil
}
return fmt.Errorf("unknown Ue numeric field %s", name)
}

View File

@ -1599,7 +1599,7 @@ type CreateUeReq struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
Owner int `json:"owner"`
}
@ -1710,7 +1710,7 @@ func (s *CreateUeReq) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *CreateUeReq) GetGameStory() OptInt {
func (s *CreateUeReq) GetGameStory() OptString {
return s.GameStory
}
@ -1830,7 +1830,7 @@ func (s *CreateUeReq) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *CreateUeReq) SetGameStory(val OptInt) {
func (s *CreateUeReq) SetGameStory(val OptString) {
s.GameStory = val
}
@ -6396,7 +6396,7 @@ type UeCreate struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -6501,7 +6501,7 @@ func (s *UeCreate) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UeCreate) GetGameStory() OptInt {
func (s *UeCreate) GetGameStory() OptString {
return s.GameStory
}
@ -6611,7 +6611,7 @@ func (s *UeCreate) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UeCreate) SetGameStory(val OptInt) {
func (s *UeCreate) SetGameStory(val OptString) {
s.GameStory = val
}
@ -6644,7 +6644,7 @@ type UeList struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -6749,7 +6749,7 @@ func (s *UeList) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UeList) GetGameStory() OptInt {
func (s *UeList) GetGameStory() OptString {
return s.GameStory
}
@ -6859,7 +6859,7 @@ func (s *UeList) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UeList) SetGameStory(val OptInt) {
func (s *UeList) SetGameStory(val OptString) {
s.GameStory = val
}
@ -7468,7 +7468,7 @@ type UeRead struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -7573,7 +7573,7 @@ func (s *UeRead) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UeRead) GetGameStory() OptInt {
func (s *UeRead) GetGameStory() OptString {
return s.GameStory
}
@ -7683,7 +7683,7 @@ func (s *UeRead) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UeRead) SetGameStory(val OptInt) {
func (s *UeRead) SetGameStory(val OptString) {
s.GameStory = val
}
@ -7716,7 +7716,7 @@ type UeUpdate struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -7821,7 +7821,7 @@ func (s *UeUpdate) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UeUpdate) GetGameStory() OptInt {
func (s *UeUpdate) GetGameStory() OptString {
return s.GameStory
}
@ -7931,7 +7931,7 @@ func (s *UeUpdate) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UeUpdate) SetGameStory(val OptInt) {
func (s *UeUpdate) SetGameStory(val OptString) {
s.GameStory = val
}
@ -8459,7 +8459,7 @@ type UpdateUeReq struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
Owner OptInt `json:"owner"`
}
@ -8564,7 +8564,7 @@ func (s *UpdateUeReq) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UpdateUeReq) GetGameStory() OptInt {
func (s *UpdateUeReq) GetGameStory() OptString {
return s.GameStory
}
@ -8674,7 +8674,7 @@ func (s *UpdateUeReq) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UpdateUeReq) SetGameStory(val OptInt) {
func (s *UpdateUeReq) SetGameStory(val OptString) {
s.GameStory = val
}
@ -11508,7 +11508,7 @@ type UserUeList struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
GameStory OptString `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -11613,7 +11613,7 @@ func (s *UserUeList) GetGameID() OptString {
}
// GetGameStory returns the value of GameStory.
func (s *UserUeList) GetGameStory() OptInt {
func (s *UserUeList) GetGameStory() OptString {
return s.GameStory
}
@ -11723,7 +11723,7 @@ func (s *UserUeList) SetGameID(val OptString) {
}
// SetGameStory sets the value of GameStory.
func (s *UserUeList) SetGameStory(val OptInt) {
func (s *UserUeList) SetGameStory(val OptString) {
s.GameStory = val
}

View File

@ -933,7 +933,7 @@ func NewUeCreate(e *ent.Ue) *UeCreate {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameStory = NewOptString(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -981,7 +981,7 @@ func NewUeList(e *ent.Ue) *UeList {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameStory = NewOptString(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1029,7 +1029,7 @@ func NewUeRead(e *ent.Ue) *UeRead {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameStory = NewOptString(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1077,7 +1077,7 @@ func NewUeUpdate(e *ent.Ue) *UeUpdate {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameStory = NewOptString(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1635,7 +1635,7 @@ func NewUserUeList(e *ent.Ue) *UserUeList {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameStory = NewOptString(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}

View File

@ -1627,7 +1627,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -1835,7 +1835,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"owner": {
"type": "integer"
@ -4481,7 +4481,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -4561,7 +4561,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -4636,7 +4636,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -4711,7 +4711,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -4786,7 +4786,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",
@ -6097,7 +6097,7 @@
"type": "string"
},
"game_story": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string",

View File

@ -84,7 +84,7 @@ func (Ue) Fields() []ent.Field {
field.String("game_id").
Optional(),
field.Int("game_story").
field.String("game_story").
Optional(),
field.Time("created_at").

View File

@ -61,7 +61,7 @@ type Ue struct {
// GameID holds the value of the "game_id" field.
GameID string `json:"game_id,omitempty"`
// GameStory holds the value of the "game_story" field.
GameStory int `json:"game_story,omitempty"`
GameStory string `json:"game_story,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
@ -100,9 +100,9 @@ func (*Ue) scanValues(columns []string) ([]any, error) {
switch columns[i] {
case ue.FieldLimit, ue.FieldLimitBoss, ue.FieldLimitItem:
values[i] = new(sql.NullBool)
case ue.FieldID, ue.FieldLv, ue.FieldLvPoint, ue.FieldModel, ue.FieldSword, ue.FieldCard, ue.FieldCp, ue.FieldCount, ue.FieldLocationX, ue.FieldLocationY, ue.FieldLocationZ, ue.FieldLocationN, ue.FieldGameStory:
case ue.FieldID, ue.FieldLv, ue.FieldLvPoint, ue.FieldModel, ue.FieldSword, ue.FieldCard, ue.FieldCp, ue.FieldCount, ue.FieldLocationX, ue.FieldLocationY, ue.FieldLocationZ, ue.FieldLocationN:
values[i] = new(sql.NullInt64)
case ue.FieldPassword, ue.FieldMode, ue.FieldToken, ue.FieldAuthor, ue.FieldGameLv, ue.FieldGameExp, ue.FieldGameID:
case ue.FieldPassword, ue.FieldMode, ue.FieldToken, ue.FieldAuthor, ue.FieldGameLv, ue.FieldGameExp, ue.FieldGameID, ue.FieldGameStory:
values[i] = new(sql.NullString)
case ue.FieldCreatedAt:
values[i] = new(sql.NullTime)
@ -256,10 +256,10 @@ func (u *Ue) assignValues(columns []string, values []any) error {
u.GameID = value.String
}
case ue.FieldGameStory:
if value, ok := values[i].(*sql.NullInt64); !ok {
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field game_story", values[i])
} else if value.Valid {
u.GameStory = int(value.Int64)
u.GameStory = value.String
}
case ue.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
@ -377,7 +377,7 @@ func (u *Ue) String() string {
builder.WriteString(u.GameID)
builder.WriteString(", ")
builder.WriteString("game_story=")
builder.WriteString(fmt.Sprintf("%v", u.GameStory))
builder.WriteString(u.GameStory)
builder.WriteString(", ")
builder.WriteString("created_at=")
builder.WriteString(u.CreatedAt.Format(time.ANSIC))

View File

@ -161,7 +161,7 @@ func GameID(v string) predicate.Ue {
}
// GameStory applies equality check predicate on the "game_story" field. It's identical to GameStoryEQ.
func GameStory(v int) predicate.Ue {
func GameStory(v string) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldGameStory, v))
}
@ -1296,45 +1296,60 @@ func GameIDContainsFold(v string) predicate.Ue {
}
// GameStoryEQ applies the EQ predicate on the "game_story" field.
func GameStoryEQ(v int) predicate.Ue {
func GameStoryEQ(v string) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldGameStory, v))
}
// GameStoryNEQ applies the NEQ predicate on the "game_story" field.
func GameStoryNEQ(v int) predicate.Ue {
func GameStoryNEQ(v string) predicate.Ue {
return predicate.Ue(sql.FieldNEQ(FieldGameStory, v))
}
// GameStoryIn applies the In predicate on the "game_story" field.
func GameStoryIn(vs ...int) predicate.Ue {
func GameStoryIn(vs ...string) predicate.Ue {
return predicate.Ue(sql.FieldIn(FieldGameStory, vs...))
}
// GameStoryNotIn applies the NotIn predicate on the "game_story" field.
func GameStoryNotIn(vs ...int) predicate.Ue {
func GameStoryNotIn(vs ...string) predicate.Ue {
return predicate.Ue(sql.FieldNotIn(FieldGameStory, vs...))
}
// GameStoryGT applies the GT predicate on the "game_story" field.
func GameStoryGT(v int) predicate.Ue {
func GameStoryGT(v string) predicate.Ue {
return predicate.Ue(sql.FieldGT(FieldGameStory, v))
}
// GameStoryGTE applies the GTE predicate on the "game_story" field.
func GameStoryGTE(v int) predicate.Ue {
func GameStoryGTE(v string) predicate.Ue {
return predicate.Ue(sql.FieldGTE(FieldGameStory, v))
}
// GameStoryLT applies the LT predicate on the "game_story" field.
func GameStoryLT(v int) predicate.Ue {
func GameStoryLT(v string) predicate.Ue {
return predicate.Ue(sql.FieldLT(FieldGameStory, v))
}
// GameStoryLTE applies the LTE predicate on the "game_story" field.
func GameStoryLTE(v int) predicate.Ue {
func GameStoryLTE(v string) predicate.Ue {
return predicate.Ue(sql.FieldLTE(FieldGameStory, v))
}
// GameStoryContains applies the Contains predicate on the "game_story" field.
func GameStoryContains(v string) predicate.Ue {
return predicate.Ue(sql.FieldContains(FieldGameStory, v))
}
// GameStoryHasPrefix applies the HasPrefix predicate on the "game_story" field.
func GameStoryHasPrefix(v string) predicate.Ue {
return predicate.Ue(sql.FieldHasPrefix(FieldGameStory, v))
}
// GameStoryHasSuffix applies the HasSuffix predicate on the "game_story" field.
func GameStoryHasSuffix(v string) predicate.Ue {
return predicate.Ue(sql.FieldHasSuffix(FieldGameStory, v))
}
// GameStoryIsNil applies the IsNil predicate on the "game_story" field.
func GameStoryIsNil() predicate.Ue {
return predicate.Ue(sql.FieldIsNull(FieldGameStory))
@ -1345,6 +1360,16 @@ func GameStoryNotNil() predicate.Ue {
return predicate.Ue(sql.FieldNotNull(FieldGameStory))
}
// GameStoryEqualFold applies the EqualFold predicate on the "game_story" field.
func GameStoryEqualFold(v string) predicate.Ue {
return predicate.Ue(sql.FieldEqualFold(FieldGameStory, v))
}
// GameStoryContainsFold applies the ContainsFold predicate on the "game_story" field.
func GameStoryContainsFold(v string) predicate.Ue {
return predicate.Ue(sql.FieldContainsFold(FieldGameStory, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldCreatedAt, v))

View File

@ -308,15 +308,15 @@ func (uc *UeCreate) SetNillableGameID(s *string) *UeCreate {
}
// SetGameStory sets the "game_story" field.
func (uc *UeCreate) SetGameStory(i int) *UeCreate {
uc.mutation.SetGameStory(i)
func (uc *UeCreate) SetGameStory(s string) *UeCreate {
uc.mutation.SetGameStory(s)
return uc
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uc *UeCreate) SetNillableGameStory(i *int) *UeCreate {
if i != nil {
uc.SetGameStory(*i)
func (uc *UeCreate) SetNillableGameStory(s *string) *UeCreate {
if s != nil {
uc.SetGameStory(*s)
}
return uc
}
@ -523,7 +523,7 @@ func (uc *UeCreate) createSpec() (*Ue, *sqlgraph.CreateSpec) {
_node.GameID = value
}
if value, ok := uc.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
_spec.SetField(ue.FieldGameStory, field.TypeString, value)
_node.GameStory = value
}
if value, ok := uc.mutation.CreatedAt(); ok {

View File

@ -506,26 +506,19 @@ func (uu *UeUpdate) ClearGameID() *UeUpdate {
}
// SetGameStory sets the "game_story" field.
func (uu *UeUpdate) SetGameStory(i int) *UeUpdate {
uu.mutation.ResetGameStory()
uu.mutation.SetGameStory(i)
func (uu *UeUpdate) SetGameStory(s string) *UeUpdate {
uu.mutation.SetGameStory(s)
return uu
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uu *UeUpdate) SetNillableGameStory(i *int) *UeUpdate {
if i != nil {
uu.SetGameStory(*i)
func (uu *UeUpdate) SetNillableGameStory(s *string) *UeUpdate {
if s != nil {
uu.SetGameStory(*s)
}
return uu
}
// AddGameStory adds i to the "game_story" field.
func (uu *UeUpdate) AddGameStory(i int) *UeUpdate {
uu.mutation.AddGameStory(i)
return uu
}
// ClearGameStory clears the value of the "game_story" field.
func (uu *UeUpdate) ClearGameStory() *UeUpdate {
uu.mutation.ClearGameStory()
@ -755,13 +748,10 @@ func (uu *UeUpdate) sqlSave(ctx context.Context) (n int, err error) {
_spec.ClearField(ue.FieldGameID, field.TypeString)
}
if value, ok := uu.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameStory(); ok {
_spec.AddField(ue.FieldGameStory, field.TypeInt, value)
_spec.SetField(ue.FieldGameStory, field.TypeString, value)
}
if uu.mutation.GameStoryCleared() {
_spec.ClearField(ue.FieldGameStory, field.TypeInt)
_spec.ClearField(ue.FieldGameStory, field.TypeString)
}
if uu.mutation.CreatedAtCleared() {
_spec.ClearField(ue.FieldCreatedAt, field.TypeTime)
@ -1293,26 +1283,19 @@ func (uuo *UeUpdateOne) ClearGameID() *UeUpdateOne {
}
// SetGameStory sets the "game_story" field.
func (uuo *UeUpdateOne) SetGameStory(i int) *UeUpdateOne {
uuo.mutation.ResetGameStory()
uuo.mutation.SetGameStory(i)
func (uuo *UeUpdateOne) SetGameStory(s string) *UeUpdateOne {
uuo.mutation.SetGameStory(s)
return uuo
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uuo *UeUpdateOne) SetNillableGameStory(i *int) *UeUpdateOne {
if i != nil {
uuo.SetGameStory(*i)
func (uuo *UeUpdateOne) SetNillableGameStory(s *string) *UeUpdateOne {
if s != nil {
uuo.SetGameStory(*s)
}
return uuo
}
// AddGameStory adds i to the "game_story" field.
func (uuo *UeUpdateOne) AddGameStory(i int) *UeUpdateOne {
uuo.mutation.AddGameStory(i)
return uuo
}
// ClearGameStory clears the value of the "game_story" field.
func (uuo *UeUpdateOne) ClearGameStory() *UeUpdateOne {
uuo.mutation.ClearGameStory()
@ -1572,13 +1555,10 @@ func (uuo *UeUpdateOne) sqlSave(ctx context.Context) (_node *Ue, err error) {
_spec.ClearField(ue.FieldGameID, field.TypeString)
}
if value, ok := uuo.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameStory(); ok {
_spec.AddField(ue.FieldGameStory, field.TypeInt, value)
_spec.SetField(ue.FieldGameStory, field.TypeString, value)
}
if uuo.mutation.GameStoryCleared() {
_spec.ClearField(ue.FieldGameStory, field.TypeInt)
_spec.ClearField(ue.FieldGameStory, field.TypeString)
}
if uuo.mutation.CreatedAtCleared() {
_spec.ClearField(ue.FieldCreatedAt, field.TypeTime)