return color by string, added rounds since maxrounds is not defined in pre-riptide matches
This commit is contained in:
12
ent/match.go
12
ent/match.go
@@ -35,6 +35,8 @@ type Match struct {
|
||||
MatchResult int `json:"match_result,omitempty"`
|
||||
// MaxRounds holds the value of the "max_rounds" field.
|
||||
MaxRounds int `json:"max_rounds,omitempty"`
|
||||
// Rounds holds the value of the "rounds" field.
|
||||
Rounds int `json:"rounds,omitempty"`
|
||||
// DemoExpired holds the value of the "demo_expired" field.
|
||||
DemoExpired bool `json:"demo_expired,omitempty"`
|
||||
// DemoParsed holds the value of the "demo_parsed" field.
|
||||
@@ -90,7 +92,7 @@ func (*Match) scanValues(columns []string) ([]interface{}, error) {
|
||||
values[i] = new([]byte)
|
||||
case match.FieldDemoExpired, match.FieldDemoParsed:
|
||||
values[i] = new(sql.NullBool)
|
||||
case match.FieldID, match.FieldScoreTeamA, match.FieldScoreTeamB, match.FieldDuration, match.FieldMatchResult, match.FieldMaxRounds:
|
||||
case match.FieldID, match.FieldScoreTeamA, match.FieldScoreTeamB, match.FieldDuration, match.FieldMatchResult, match.FieldMaxRounds, match.FieldRounds:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case match.FieldShareCode, match.FieldMap, match.FieldReplayURL:
|
||||
values[i] = new(sql.NullString)
|
||||
@@ -171,6 +173,12 @@ func (m *Match) assignValues(columns []string, values []interface{}) error {
|
||||
} else if value.Valid {
|
||||
m.MaxRounds = int(value.Int64)
|
||||
}
|
||||
case match.FieldRounds:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field rounds", values[i])
|
||||
} else if value.Valid {
|
||||
m.Rounds = int(value.Int64)
|
||||
}
|
||||
case match.FieldDemoExpired:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field demo_expired", values[i])
|
||||
@@ -247,6 +255,8 @@ func (m *Match) String() string {
|
||||
builder.WriteString(fmt.Sprintf("%v", m.MatchResult))
|
||||
builder.WriteString(", max_rounds=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.MaxRounds))
|
||||
builder.WriteString(", rounds=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.Rounds))
|
||||
builder.WriteString(", demo_expired=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.DemoExpired))
|
||||
builder.WriteString(", demo_parsed=")
|
||||
|
@@ -25,6 +25,8 @@ const (
|
||||
FieldMatchResult = "match_result"
|
||||
// FieldMaxRounds holds the string denoting the max_rounds field in the database.
|
||||
FieldMaxRounds = "max_rounds"
|
||||
// FieldRounds holds the string denoting the rounds field in the database.
|
||||
FieldRounds = "rounds"
|
||||
// FieldDemoExpired holds the string denoting the demo_expired field in the database.
|
||||
FieldDemoExpired = "demo_expired"
|
||||
// FieldDemoParsed holds the string denoting the demo_parsed field in the database.
|
||||
@@ -63,6 +65,7 @@ var Columns = []string{
|
||||
FieldDuration,
|
||||
FieldMatchResult,
|
||||
FieldMaxRounds,
|
||||
FieldRounds,
|
||||
FieldDemoExpired,
|
||||
FieldDemoParsed,
|
||||
FieldEco,
|
||||
|
@@ -156,6 +156,13 @@ func MaxRounds(v int) predicate.Match {
|
||||
})
|
||||
}
|
||||
|
||||
// Rounds applies equality check predicate on the "rounds" field. It's identical to RoundsEQ.
|
||||
func Rounds(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DemoExpired applies equality check predicate on the "demo_expired" field. It's identical to DemoExpiredEQ.
|
||||
func DemoExpired(v bool) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
@@ -987,6 +994,82 @@ func MaxRoundsLTE(v int) predicate.Match {
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsEQ applies the EQ predicate on the "rounds" field.
|
||||
func RoundsEQ(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsNEQ applies the NEQ predicate on the "rounds" field.
|
||||
func RoundsNEQ(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsIn applies the In predicate on the "rounds" field.
|
||||
func RoundsIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldRounds), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsNotIn applies the NotIn predicate on the "rounds" field.
|
||||
func RoundsNotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldRounds), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsGT applies the GT predicate on the "rounds" field.
|
||||
func RoundsGT(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsGTE applies the GTE predicate on the "rounds" field.
|
||||
func RoundsGTE(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsLT applies the LT predicate on the "rounds" field.
|
||||
func RoundsLT(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RoundsLTE applies the LTE predicate on the "rounds" field.
|
||||
func RoundsLTE(v int) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldRounds), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DemoExpiredEQ applies the EQ predicate on the "demo_expired" field.
|
||||
func DemoExpiredEQ(v bool) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
|
@@ -92,6 +92,12 @@ func (mc *MatchCreate) SetMaxRounds(i int) *MatchCreate {
|
||||
return mc
|
||||
}
|
||||
|
||||
// SetRounds sets the "rounds" field.
|
||||
func (mc *MatchCreate) SetRounds(i int) *MatchCreate {
|
||||
mc.mutation.SetRounds(i)
|
||||
return mc
|
||||
}
|
||||
|
||||
// SetDemoExpired sets the "demo_expired" field.
|
||||
func (mc *MatchCreate) SetDemoExpired(b bool) *MatchCreate {
|
||||
mc.mutation.SetDemoExpired(b)
|
||||
@@ -286,6 +292,9 @@ func (mc *MatchCreate) check() error {
|
||||
if _, ok := mc.mutation.MaxRounds(); !ok {
|
||||
return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "max_rounds"`)}
|
||||
}
|
||||
if _, ok := mc.mutation.Rounds(); !ok {
|
||||
return &ValidationError{Name: "rounds", err: errors.New(`ent: missing required field "rounds"`)}
|
||||
}
|
||||
if _, ok := mc.mutation.DemoExpired(); !ok {
|
||||
return &ValidationError{Name: "demo_expired", err: errors.New(`ent: missing required field "demo_expired"`)}
|
||||
}
|
||||
@@ -397,6 +406,14 @@ func (mc *MatchCreate) createSpec() (*Match, *sqlgraph.CreateSpec) {
|
||||
})
|
||||
_node.MaxRounds = value
|
||||
}
|
||||
if value, ok := mc.mutation.Rounds(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldRounds,
|
||||
})
|
||||
_node.Rounds = value
|
||||
}
|
||||
if value, ok := mc.mutation.DemoExpired(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
|
@@ -146,6 +146,19 @@ func (mu *MatchUpdate) AddMaxRounds(i int) *MatchUpdate {
|
||||
return mu
|
||||
}
|
||||
|
||||
// SetRounds sets the "rounds" field.
|
||||
func (mu *MatchUpdate) SetRounds(i int) *MatchUpdate {
|
||||
mu.mutation.ResetRounds()
|
||||
mu.mutation.SetRounds(i)
|
||||
return mu
|
||||
}
|
||||
|
||||
// AddRounds adds i to the "rounds" field.
|
||||
func (mu *MatchUpdate) AddRounds(i int) *MatchUpdate {
|
||||
mu.mutation.AddRounds(i)
|
||||
return mu
|
||||
}
|
||||
|
||||
// SetDemoExpired sets the "demo_expired" field.
|
||||
func (mu *MatchUpdate) SetDemoExpired(b bool) *MatchUpdate {
|
||||
mu.mutation.SetDemoExpired(b)
|
||||
@@ -465,6 +478,20 @@ func (mu *MatchUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := mu.mutation.Rounds(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := mu.mutation.AddedRounds(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := mu.mutation.DemoExpired(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
@@ -736,6 +763,19 @@ func (muo *MatchUpdateOne) AddMaxRounds(i int) *MatchUpdateOne {
|
||||
return muo
|
||||
}
|
||||
|
||||
// SetRounds sets the "rounds" field.
|
||||
func (muo *MatchUpdateOne) SetRounds(i int) *MatchUpdateOne {
|
||||
muo.mutation.ResetRounds()
|
||||
muo.mutation.SetRounds(i)
|
||||
return muo
|
||||
}
|
||||
|
||||
// AddRounds adds i to the "rounds" field.
|
||||
func (muo *MatchUpdateOne) AddRounds(i int) *MatchUpdateOne {
|
||||
muo.mutation.AddRounds(i)
|
||||
return muo
|
||||
}
|
||||
|
||||
// SetDemoExpired sets the "demo_expired" field.
|
||||
func (muo *MatchUpdateOne) SetDemoExpired(b bool) *MatchUpdateOne {
|
||||
muo.mutation.SetDemoExpired(b)
|
||||
@@ -1079,6 +1119,20 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := muo.mutation.Rounds(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := muo.mutation.AddedRounds(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldRounds,
|
||||
})
|
||||
}
|
||||
if value, ok := muo.mutation.DemoExpired(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
|
@@ -20,6 +20,7 @@ var (
|
||||
{Name: "duration", Type: field.TypeInt},
|
||||
{Name: "match_result", Type: field.TypeInt},
|
||||
{Name: "max_rounds", Type: field.TypeInt},
|
||||
{Name: "rounds", Type: field.TypeInt},
|
||||
{Name: "demo_expired", Type: field.TypeBool, Default: false},
|
||||
{Name: "demo_parsed", Type: field.TypeBool, Default: false},
|
||||
{Name: "eco", Type: field.TypeJSON, Nullable: true},
|
||||
|
@@ -49,6 +49,8 @@ type MatchMutation struct {
|
||||
addmatch_result *int
|
||||
max_rounds *int
|
||||
addmax_rounds *int
|
||||
rounds *int
|
||||
addrounds *int
|
||||
demo_expired *bool
|
||||
demo_parsed *bool
|
||||
eco *struct {
|
||||
@@ -605,6 +607,62 @@ func (m *MatchMutation) ResetMaxRounds() {
|
||||
m.addmax_rounds = nil
|
||||
}
|
||||
|
||||
// SetRounds sets the "rounds" field.
|
||||
func (m *MatchMutation) SetRounds(i int) {
|
||||
m.rounds = &i
|
||||
m.addrounds = nil
|
||||
}
|
||||
|
||||
// Rounds returns the value of the "rounds" field in the mutation.
|
||||
func (m *MatchMutation) Rounds() (r int, exists bool) {
|
||||
v := m.rounds
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldRounds returns the old "rounds" field's value of the Match entity.
|
||||
// If the Match 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 *MatchMutation) OldRounds(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldRounds is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, fmt.Errorf("OldRounds requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldRounds: %w", err)
|
||||
}
|
||||
return oldValue.Rounds, nil
|
||||
}
|
||||
|
||||
// AddRounds adds i to the "rounds" field.
|
||||
func (m *MatchMutation) AddRounds(i int) {
|
||||
if m.addrounds != nil {
|
||||
*m.addrounds += i
|
||||
} else {
|
||||
m.addrounds = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedRounds returns the value that was added to the "rounds" field in this mutation.
|
||||
func (m *MatchMutation) AddedRounds() (r int, exists bool) {
|
||||
v := m.addrounds
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetRounds resets all changes to the "rounds" field.
|
||||
func (m *MatchMutation) ResetRounds() {
|
||||
m.rounds = nil
|
||||
m.addrounds = nil
|
||||
}
|
||||
|
||||
// SetDemoExpired sets the "demo_expired" field.
|
||||
func (m *MatchMutation) SetDemoExpired(b bool) {
|
||||
m.demo_expired = &b
|
||||
@@ -871,7 +929,7 @@ func (m *MatchMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *MatchMutation) Fields() []string {
|
||||
fields := make([]string, 0, 12)
|
||||
fields := make([]string, 0, 13)
|
||||
if m.share_code != nil {
|
||||
fields = append(fields, match.FieldShareCode)
|
||||
}
|
||||
@@ -899,6 +957,9 @@ func (m *MatchMutation) Fields() []string {
|
||||
if m.max_rounds != nil {
|
||||
fields = append(fields, match.FieldMaxRounds)
|
||||
}
|
||||
if m.rounds != nil {
|
||||
fields = append(fields, match.FieldRounds)
|
||||
}
|
||||
if m.demo_expired != nil {
|
||||
fields = append(fields, match.FieldDemoExpired)
|
||||
}
|
||||
@@ -934,6 +995,8 @@ func (m *MatchMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.MatchResult()
|
||||
case match.FieldMaxRounds:
|
||||
return m.MaxRounds()
|
||||
case match.FieldRounds:
|
||||
return m.Rounds()
|
||||
case match.FieldDemoExpired:
|
||||
return m.DemoExpired()
|
||||
case match.FieldDemoParsed:
|
||||
@@ -967,6 +1030,8 @@ func (m *MatchMutation) OldField(ctx context.Context, name string) (ent.Value, e
|
||||
return m.OldMatchResult(ctx)
|
||||
case match.FieldMaxRounds:
|
||||
return m.OldMaxRounds(ctx)
|
||||
case match.FieldRounds:
|
||||
return m.OldRounds(ctx)
|
||||
case match.FieldDemoExpired:
|
||||
return m.OldDemoExpired(ctx)
|
||||
case match.FieldDemoParsed:
|
||||
@@ -1045,6 +1110,13 @@ func (m *MatchMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetMaxRounds(v)
|
||||
return nil
|
||||
case match.FieldRounds:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetRounds(v)
|
||||
return nil
|
||||
case match.FieldDemoExpired:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
@@ -1095,6 +1167,9 @@ func (m *MatchMutation) AddedFields() []string {
|
||||
if m.addmax_rounds != nil {
|
||||
fields = append(fields, match.FieldMaxRounds)
|
||||
}
|
||||
if m.addrounds != nil {
|
||||
fields = append(fields, match.FieldRounds)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -1113,6 +1188,8 @@ func (m *MatchMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return m.AddedMatchResult()
|
||||
case match.FieldMaxRounds:
|
||||
return m.AddedMaxRounds()
|
||||
case match.FieldRounds:
|
||||
return m.AddedRounds()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@@ -1157,6 +1234,13 @@ func (m *MatchMutation) AddField(name string, value ent.Value) error {
|
||||
}
|
||||
m.AddMaxRounds(v)
|
||||
return nil
|
||||
case match.FieldRounds:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddRounds(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Match numeric field %s", name)
|
||||
}
|
||||
@@ -1232,6 +1316,9 @@ func (m *MatchMutation) ResetField(name string) error {
|
||||
case match.FieldMaxRounds:
|
||||
m.ResetMaxRounds()
|
||||
return nil
|
||||
case match.FieldRounds:
|
||||
m.ResetRounds()
|
||||
return nil
|
||||
case match.FieldDemoExpired:
|
||||
m.ResetDemoExpired()
|
||||
return nil
|
||||
@@ -2556,7 +2643,7 @@ type StatsMutation struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -3086,7 +3173,7 @@ func (m *StatsMutation) SetExtended(skkgaaaallllg struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -3138,7 +3225,7 @@ func (m *StatsMutation) Extended() (r struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -3196,7 +3283,7 @@ func (m *StatsMutation) OldExtended(ctx context.Context) (v struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -3505,7 +3592,7 @@ func (m *StatsMutation) SetField(name string, value ent.Value) error {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
|
@@ -16,11 +16,11 @@ func init() {
|
||||
matchFields := schema.Match{}.Fields()
|
||||
_ = matchFields
|
||||
// matchDescDemoExpired is the schema descriptor for demo_expired field.
|
||||
matchDescDemoExpired := matchFields[10].Descriptor()
|
||||
matchDescDemoExpired := matchFields[11].Descriptor()
|
||||
// match.DefaultDemoExpired holds the default value on creation for the demo_expired field.
|
||||
match.DefaultDemoExpired = matchDescDemoExpired.Default.(bool)
|
||||
// matchDescDemoParsed is the schema descriptor for demo_parsed field.
|
||||
matchDescDemoParsed := matchFields[11].Descriptor()
|
||||
matchDescDemoParsed := matchFields[12].Descriptor()
|
||||
// match.DefaultDemoParsed holds the default value on creation for the demo_parsed field.
|
||||
match.DefaultDemoParsed = matchDescDemoParsed.Default.(bool)
|
||||
playerFields := schema.Player{}.Fields()
|
||||
|
@@ -24,6 +24,7 @@ func (Match) Fields() []ent.Field {
|
||||
field.Int("duration"),
|
||||
field.Int("match_result"),
|
||||
field.Int("max_rounds"),
|
||||
field.Int("rounds"),
|
||||
field.Bool("demo_expired").Default(false),
|
||||
field.Bool("demo_parsed").Default(false),
|
||||
field.JSON("eco", struct {
|
||||
|
@@ -50,7 +50,7 @@ func (Stats) Fields() []ent.Field {
|
||||
} `json:"hit_group,omitempty"`
|
||||
} `json:"dmg,omitempty"`
|
||||
Crosshair string `json:"crosshair,omitempty"`
|
||||
Color int `json:"color,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
KAST int `json:"kast,omitempty"`
|
||||
Rank struct {
|
||||
Old int `json:"old,omitempty"`
|
||||
|
@@ -62,7 +62,7 @@ type Stats struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
|
@@ -93,7 +93,7 @@ func (sc *StatsCreate) SetExtended(skkgaaaallllg struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -146,7 +146,7 @@ func (sc *StatsCreate) SetNillableExtended(skkgaaaallllg *struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
|
@@ -149,7 +149,7 @@ func (su *StatsUpdate) SetExtended(skkgaaaallllg struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -202,7 +202,7 @@ func (su *StatsUpdate) SetNillableExtended(skkgaaaallllg *struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -681,7 +681,7 @@ func (suo *StatsUpdateOne) SetExtended(skkgaaaallllg struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
@@ -734,7 +734,7 @@ func (suo *StatsUpdateOne) SetNillableExtended(skkgaaaallllg *struct {
|
||||
} "json:\"hit_group,omitempty\""
|
||||
} "json:\"dmg,omitempty\""
|
||||
Crosshair string "json:\"crosshair,omitempty\""
|
||||
Color int "json:\"color,omitempty\""
|
||||
Color string "json:\"color,omitempty\""
|
||||
KAST int "json:\"kast,omitempty\""
|
||||
Rank struct {
|
||||
Old int "json:\"old,omitempty\""
|
||||
|
Reference in New Issue
Block a user