added separate hash for srcinfo cache
This commit is contained in:
@@ -422,6 +422,26 @@ func (dpu *DbPackageUpdate) ClearSrcinfo() *DbPackageUpdate {
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetSrcinfoHash sets the "srcinfo_hash" field.
|
||||
func (dpu *DbPackageUpdate) SetSrcinfoHash(s string) *DbPackageUpdate {
|
||||
dpu.mutation.SetSrcinfoHash(s)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetNillableSrcinfoHash sets the "srcinfo_hash" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableSrcinfoHash(s *string) *DbPackageUpdate {
|
||||
if s != nil {
|
||||
dpu.SetSrcinfoHash(*s)
|
||||
}
|
||||
return dpu
|
||||
}
|
||||
|
||||
// ClearSrcinfoHash clears the value of the "srcinfo_hash" field.
|
||||
func (dpu *DbPackageUpdate) ClearSrcinfoHash() *DbPackageUpdate {
|
||||
dpu.mutation.ClearSrcinfoHash()
|
||||
return dpu
|
||||
}
|
||||
|
||||
// Mutation returns the DbPackageMutation object of the builder.
|
||||
func (dpu *DbPackageUpdate) Mutation() *DbPackageMutation {
|
||||
return dpu.mutation
|
||||
@@ -812,6 +832,19 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.SrcinfoHash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
}
|
||||
if dpu.mutation.SrcinfoHashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
}
|
||||
_spec.Modifiers = dpu.modifiers
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
@@ -1226,6 +1259,26 @@ func (dpuo *DbPackageUpdateOne) ClearSrcinfo() *DbPackageUpdateOne {
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetSrcinfoHash sets the "srcinfo_hash" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetSrcinfoHash(s string) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetSrcinfoHash(s)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetNillableSrcinfoHash sets the "srcinfo_hash" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableSrcinfoHash(s *string) *DbPackageUpdateOne {
|
||||
if s != nil {
|
||||
dpuo.SetSrcinfoHash(*s)
|
||||
}
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// ClearSrcinfoHash clears the value of the "srcinfo_hash" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearSrcinfoHash() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearSrcinfoHash()
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// Mutation returns the DbPackageMutation object of the builder.
|
||||
func (dpuo *DbPackageUpdateOne) Mutation() *DbPackageMutation {
|
||||
return dpuo.mutation
|
||||
@@ -1646,6 +1699,19 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.SrcinfoHash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
}
|
||||
if dpuo.mutation.SrcinfoHashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
}
|
||||
_spec.Modifiers = dpuo.modifiers
|
||||
_node = &DbPackage{config: dpuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
|
Reference in New Issue
Block a user