added spray patterns
This commit is contained in:
@@ -5,9 +5,9 @@ package ent
|
||||
import (
|
||||
"context"
|
||||
"csgowtfd/ent/match"
|
||||
"csgowtfd/ent/matchplayer"
|
||||
"csgowtfd/ent/player"
|
||||
"csgowtfd/ent/predicate"
|
||||
"csgowtfd/ent/stats"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -297,17 +297,98 @@ func (pu *PlayerUpdate) ClearOldestSharecodeSeen() *PlayerUpdate {
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddStatIDs adds the "stats" edge to the Stats entity by IDs.
|
||||
// SetWins sets the "wins" field.
|
||||
func (pu *PlayerUpdate) SetWins(i int) *PlayerUpdate {
|
||||
pu.mutation.ResetWins()
|
||||
pu.mutation.SetWins(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// SetNillableWins sets the "wins" field if the given value is not nil.
|
||||
func (pu *PlayerUpdate) SetNillableWins(i *int) *PlayerUpdate {
|
||||
if i != nil {
|
||||
pu.SetWins(*i)
|
||||
}
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddWins adds i to the "wins" field.
|
||||
func (pu *PlayerUpdate) AddWins(i int) *PlayerUpdate {
|
||||
pu.mutation.AddWins(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// ClearWins clears the value of the "wins" field.
|
||||
func (pu *PlayerUpdate) ClearWins() *PlayerUpdate {
|
||||
pu.mutation.ClearWins()
|
||||
return pu
|
||||
}
|
||||
|
||||
// SetLooses sets the "looses" field.
|
||||
func (pu *PlayerUpdate) SetLooses(i int) *PlayerUpdate {
|
||||
pu.mutation.ResetLooses()
|
||||
pu.mutation.SetLooses(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// SetNillableLooses sets the "looses" field if the given value is not nil.
|
||||
func (pu *PlayerUpdate) SetNillableLooses(i *int) *PlayerUpdate {
|
||||
if i != nil {
|
||||
pu.SetLooses(*i)
|
||||
}
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddLooses adds i to the "looses" field.
|
||||
func (pu *PlayerUpdate) AddLooses(i int) *PlayerUpdate {
|
||||
pu.mutation.AddLooses(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// ClearLooses clears the value of the "looses" field.
|
||||
func (pu *PlayerUpdate) ClearLooses() *PlayerUpdate {
|
||||
pu.mutation.ClearLooses()
|
||||
return pu
|
||||
}
|
||||
|
||||
// SetTies sets the "ties" field.
|
||||
func (pu *PlayerUpdate) SetTies(i int) *PlayerUpdate {
|
||||
pu.mutation.ResetTies()
|
||||
pu.mutation.SetTies(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// SetNillableTies sets the "ties" field if the given value is not nil.
|
||||
func (pu *PlayerUpdate) SetNillableTies(i *int) *PlayerUpdate {
|
||||
if i != nil {
|
||||
pu.SetTies(*i)
|
||||
}
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddTies adds i to the "ties" field.
|
||||
func (pu *PlayerUpdate) AddTies(i int) *PlayerUpdate {
|
||||
pu.mutation.AddTies(i)
|
||||
return pu
|
||||
}
|
||||
|
||||
// ClearTies clears the value of the "ties" field.
|
||||
func (pu *PlayerUpdate) ClearTies() *PlayerUpdate {
|
||||
pu.mutation.ClearTies()
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddStatIDs adds the "stats" edge to the MatchPlayer entity by IDs.
|
||||
func (pu *PlayerUpdate) AddStatIDs(ids ...int) *PlayerUpdate {
|
||||
pu.mutation.AddStatIDs(ids...)
|
||||
return pu
|
||||
}
|
||||
|
||||
// AddStats adds the "stats" edges to the Stats entity.
|
||||
func (pu *PlayerUpdate) AddStats(s ...*Stats) *PlayerUpdate {
|
||||
ids := make([]int, len(s))
|
||||
for i := range s {
|
||||
ids[i] = s[i].ID
|
||||
// AddStats adds the "stats" edges to the MatchPlayer entity.
|
||||
func (pu *PlayerUpdate) AddStats(m ...*MatchPlayer) *PlayerUpdate {
|
||||
ids := make([]int, len(m))
|
||||
for i := range m {
|
||||
ids[i] = m[i].ID
|
||||
}
|
||||
return pu.AddStatIDs(ids...)
|
||||
}
|
||||
@@ -332,23 +413,23 @@ func (pu *PlayerUpdate) Mutation() *PlayerMutation {
|
||||
return pu.mutation
|
||||
}
|
||||
|
||||
// ClearStats clears all "stats" edges to the Stats entity.
|
||||
// ClearStats clears all "stats" edges to the MatchPlayer entity.
|
||||
func (pu *PlayerUpdate) ClearStats() *PlayerUpdate {
|
||||
pu.mutation.ClearStats()
|
||||
return pu
|
||||
}
|
||||
|
||||
// RemoveStatIDs removes the "stats" edge to Stats entities by IDs.
|
||||
// RemoveStatIDs removes the "stats" edge to MatchPlayer entities by IDs.
|
||||
func (pu *PlayerUpdate) RemoveStatIDs(ids ...int) *PlayerUpdate {
|
||||
pu.mutation.RemoveStatIDs(ids...)
|
||||
return pu
|
||||
}
|
||||
|
||||
// RemoveStats removes "stats" edges to Stats entities.
|
||||
func (pu *PlayerUpdate) RemoveStats(s ...*Stats) *PlayerUpdate {
|
||||
ids := make([]int, len(s))
|
||||
for i := range s {
|
||||
ids[i] = s[i].ID
|
||||
// RemoveStats removes "stats" edges to MatchPlayer entities.
|
||||
func (pu *PlayerUpdate) RemoveStats(m ...*MatchPlayer) *PlayerUpdate {
|
||||
ids := make([]int, len(m))
|
||||
for i := range m {
|
||||
ids[i] = m[i].ID
|
||||
}
|
||||
return pu.RemoveStatIDs(ids...)
|
||||
}
|
||||
@@ -623,6 +704,66 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.Wins(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.AddedWins(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if pu.mutation.WinsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.Looses(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.AddedLooses(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if pu.mutation.LoosesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.Ties(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if value, ok := pu.mutation.AddedTies(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if pu.mutation.TiesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if pu.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
@@ -633,7 +774,7 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -649,7 +790,7 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -668,7 +809,7 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1018,17 +1159,98 @@ func (puo *PlayerUpdateOne) ClearOldestSharecodeSeen() *PlayerUpdateOne {
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddStatIDs adds the "stats" edge to the Stats entity by IDs.
|
||||
// SetWins sets the "wins" field.
|
||||
func (puo *PlayerUpdateOne) SetWins(i int) *PlayerUpdateOne {
|
||||
puo.mutation.ResetWins()
|
||||
puo.mutation.SetWins(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// SetNillableWins sets the "wins" field if the given value is not nil.
|
||||
func (puo *PlayerUpdateOne) SetNillableWins(i *int) *PlayerUpdateOne {
|
||||
if i != nil {
|
||||
puo.SetWins(*i)
|
||||
}
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddWins adds i to the "wins" field.
|
||||
func (puo *PlayerUpdateOne) AddWins(i int) *PlayerUpdateOne {
|
||||
puo.mutation.AddWins(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// ClearWins clears the value of the "wins" field.
|
||||
func (puo *PlayerUpdateOne) ClearWins() *PlayerUpdateOne {
|
||||
puo.mutation.ClearWins()
|
||||
return puo
|
||||
}
|
||||
|
||||
// SetLooses sets the "looses" field.
|
||||
func (puo *PlayerUpdateOne) SetLooses(i int) *PlayerUpdateOne {
|
||||
puo.mutation.ResetLooses()
|
||||
puo.mutation.SetLooses(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// SetNillableLooses sets the "looses" field if the given value is not nil.
|
||||
func (puo *PlayerUpdateOne) SetNillableLooses(i *int) *PlayerUpdateOne {
|
||||
if i != nil {
|
||||
puo.SetLooses(*i)
|
||||
}
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddLooses adds i to the "looses" field.
|
||||
func (puo *PlayerUpdateOne) AddLooses(i int) *PlayerUpdateOne {
|
||||
puo.mutation.AddLooses(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// ClearLooses clears the value of the "looses" field.
|
||||
func (puo *PlayerUpdateOne) ClearLooses() *PlayerUpdateOne {
|
||||
puo.mutation.ClearLooses()
|
||||
return puo
|
||||
}
|
||||
|
||||
// SetTies sets the "ties" field.
|
||||
func (puo *PlayerUpdateOne) SetTies(i int) *PlayerUpdateOne {
|
||||
puo.mutation.ResetTies()
|
||||
puo.mutation.SetTies(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// SetNillableTies sets the "ties" field if the given value is not nil.
|
||||
func (puo *PlayerUpdateOne) SetNillableTies(i *int) *PlayerUpdateOne {
|
||||
if i != nil {
|
||||
puo.SetTies(*i)
|
||||
}
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddTies adds i to the "ties" field.
|
||||
func (puo *PlayerUpdateOne) AddTies(i int) *PlayerUpdateOne {
|
||||
puo.mutation.AddTies(i)
|
||||
return puo
|
||||
}
|
||||
|
||||
// ClearTies clears the value of the "ties" field.
|
||||
func (puo *PlayerUpdateOne) ClearTies() *PlayerUpdateOne {
|
||||
puo.mutation.ClearTies()
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddStatIDs adds the "stats" edge to the MatchPlayer entity by IDs.
|
||||
func (puo *PlayerUpdateOne) AddStatIDs(ids ...int) *PlayerUpdateOne {
|
||||
puo.mutation.AddStatIDs(ids...)
|
||||
return puo
|
||||
}
|
||||
|
||||
// AddStats adds the "stats" edges to the Stats entity.
|
||||
func (puo *PlayerUpdateOne) AddStats(s ...*Stats) *PlayerUpdateOne {
|
||||
ids := make([]int, len(s))
|
||||
for i := range s {
|
||||
ids[i] = s[i].ID
|
||||
// AddStats adds the "stats" edges to the MatchPlayer entity.
|
||||
func (puo *PlayerUpdateOne) AddStats(m ...*MatchPlayer) *PlayerUpdateOne {
|
||||
ids := make([]int, len(m))
|
||||
for i := range m {
|
||||
ids[i] = m[i].ID
|
||||
}
|
||||
return puo.AddStatIDs(ids...)
|
||||
}
|
||||
@@ -1053,23 +1275,23 @@ func (puo *PlayerUpdateOne) Mutation() *PlayerMutation {
|
||||
return puo.mutation
|
||||
}
|
||||
|
||||
// ClearStats clears all "stats" edges to the Stats entity.
|
||||
// ClearStats clears all "stats" edges to the MatchPlayer entity.
|
||||
func (puo *PlayerUpdateOne) ClearStats() *PlayerUpdateOne {
|
||||
puo.mutation.ClearStats()
|
||||
return puo
|
||||
}
|
||||
|
||||
// RemoveStatIDs removes the "stats" edge to Stats entities by IDs.
|
||||
// RemoveStatIDs removes the "stats" edge to MatchPlayer entities by IDs.
|
||||
func (puo *PlayerUpdateOne) RemoveStatIDs(ids ...int) *PlayerUpdateOne {
|
||||
puo.mutation.RemoveStatIDs(ids...)
|
||||
return puo
|
||||
}
|
||||
|
||||
// RemoveStats removes "stats" edges to Stats entities.
|
||||
func (puo *PlayerUpdateOne) RemoveStats(s ...*Stats) *PlayerUpdateOne {
|
||||
ids := make([]int, len(s))
|
||||
for i := range s {
|
||||
ids[i] = s[i].ID
|
||||
// RemoveStats removes "stats" edges to MatchPlayer entities.
|
||||
func (puo *PlayerUpdateOne) RemoveStats(m ...*MatchPlayer) *PlayerUpdateOne {
|
||||
ids := make([]int, len(m))
|
||||
for i := range m {
|
||||
ids[i] = m[i].ID
|
||||
}
|
||||
return puo.RemoveStatIDs(ids...)
|
||||
}
|
||||
@@ -1368,6 +1590,66 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.Wins(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.AddedWins(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if puo.mutation.WinsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.Looses(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.AddedLooses(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if puo.mutation.LoosesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.Ties(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if value, ok := puo.mutation.AddedTies(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if puo.mutation.TiesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
}
|
||||
if puo.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
@@ -1378,7 +1660,7 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1394,7 +1676,7 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1413,7 +1695,7 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user