deleted round from db/response

This commit is contained in:
2021-10-09 00:57:05 +02:00
parent 1355dfad8d
commit 15b273f052
11 changed files with 4 additions and 264 deletions

View File

@@ -49,8 +49,6 @@ type MatchMutation struct {
addmatch_result *int
max_rounds *int
addmax_rounds *int
rounds *int
addrounds *int
demo_expired *bool
demo_parsed *bool
eco *struct {
@@ -607,62 +605,6 @@ 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
@@ -929,7 +871,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, 13)
fields := make([]string, 0, 12)
if m.share_code != nil {
fields = append(fields, match.FieldShareCode)
}
@@ -957,9 +899,6 @@ 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)
}
@@ -995,8 +934,6 @@ 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:
@@ -1030,8 +967,6 @@ 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:
@@ -1110,13 +1045,6 @@ 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 {
@@ -1167,9 +1095,6 @@ 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
}
@@ -1188,8 +1113,6 @@ 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
}
@@ -1234,13 +1157,6 @@ 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)
}
@@ -1316,9 +1232,6 @@ 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