forked from ALHP/ALHP.GO
added LTO status to db and status page
This commit is contained in:
@@ -211,6 +211,26 @@ func (dpu *DbPackageUpdate) ClearHash() *DbPackageUpdate {
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetLto sets the "lto" field.
|
||||
func (dpu *DbPackageUpdate) SetLto(d dbpackage.Lto) *DbPackageUpdate {
|
||||
dpu.mutation.SetLto(d)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetNillableLto sets the "lto" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableLto(d *dbpackage.Lto) *DbPackageUpdate {
|
||||
if d != nil {
|
||||
dpu.SetLto(*d)
|
||||
}
|
||||
return dpu
|
||||
}
|
||||
|
||||
// ClearLto clears the value of the "lto" field.
|
||||
func (dpu *DbPackageUpdate) ClearLto() *DbPackageUpdate {
|
||||
dpu.mutation.ClearLto()
|
||||
return dpu
|
||||
}
|
||||
|
||||
// Mutation returns the DbPackageMutation object of the builder.
|
||||
func (dpu *DbPackageUpdate) Mutation() *DbPackageMutation {
|
||||
return dpu.mutation
|
||||
@@ -293,6 +313,11 @@ func (dpu *DbPackageUpdate) check() error {
|
||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
||||
}
|
||||
}
|
||||
if v, ok := dpu.mutation.Lto(); ok {
|
||||
if err := dbpackage.LtoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -445,6 +470,19 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.Lto(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
}
|
||||
if dpu.mutation.LtoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
}
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{dbpackage.Label}
|
||||
@@ -648,6 +686,26 @@ func (dpuo *DbPackageUpdateOne) ClearHash() *DbPackageUpdateOne {
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetLto sets the "lto" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetLto(d dbpackage.Lto) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetLto(d)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetNillableLto sets the "lto" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableLto(d *dbpackage.Lto) *DbPackageUpdateOne {
|
||||
if d != nil {
|
||||
dpuo.SetLto(*d)
|
||||
}
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// ClearLto clears the value of the "lto" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearLto() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearLto()
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// Mutation returns the DbPackageMutation object of the builder.
|
||||
func (dpuo *DbPackageUpdateOne) Mutation() *DbPackageMutation {
|
||||
return dpuo.mutation
|
||||
@@ -737,6 +795,11 @@ func (dpuo *DbPackageUpdateOne) check() error {
|
||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
||||
}
|
||||
}
|
||||
if v, ok := dpuo.mutation.Lto(); ok {
|
||||
if err := dbpackage.LtoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -906,6 +969,19 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.Lto(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
}
|
||||
if dpuo.mutation.LtoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
}
|
||||
_node = &DbPackage{config: dpuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
Reference in New Issue
Block a user