fill history if an older match appeared

This commit is contained in:
2021-10-21 16:50:30 +02:00
parent d9f944c3d6
commit b39efe9d9a
9 changed files with 352 additions and 31 deletions

View File

@@ -176,6 +176,20 @@ func (pc *PlayerCreate) SetNillableProfileCreated(t *time.Time) *PlayerCreate {
return pc
}
// SetOldestSharecodeSeen sets the "oldest_sharecode_seen" field.
func (pc *PlayerCreate) SetOldestSharecodeSeen(s string) *PlayerCreate {
pc.mutation.SetOldestSharecodeSeen(s)
return pc
}
// SetNillableOldestSharecodeSeen sets the "oldest_sharecode_seen" field if the given value is not nil.
func (pc *PlayerCreate) SetNillableOldestSharecodeSeen(s *string) *PlayerCreate {
if s != nil {
pc.SetOldestSharecodeSeen(*s)
}
return pc
}
// SetID sets the "id" field.
func (pc *PlayerCreate) SetID(u uint64) *PlayerCreate {
pc.mutation.SetID(u)
@@ -422,6 +436,14 @@ func (pc *PlayerCreate) createSpec() (*Player, *sqlgraph.CreateSpec) {
})
_node.ProfileCreated = value
}
if value, ok := pc.mutation.OldestSharecodeSeen(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeString,
Value: value,
Column: player.FieldOldestSharecodeSeen,
})
_node.OldestSharecodeSeen = value
}
if nodes := pc.mutation.StatsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,