|
@@ -63,26 +63,6 @@ func (lru *LabelRelationshipUpdate) ClearStatus() *LabelRelationshipUpdate {
|
|
return lru
|
|
return lru
|
|
}
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
|
-func (lru *LabelRelationshipUpdate) SetDeletedAt(t time.Time) *LabelRelationshipUpdate {
|
|
|
|
- lru.mutation.SetDeletedAt(t)
|
|
|
|
- return lru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
|
-func (lru *LabelRelationshipUpdate) SetNillableDeletedAt(t *time.Time) *LabelRelationshipUpdate {
|
|
|
|
- if t != nil {
|
|
|
|
- lru.SetDeletedAt(*t)
|
|
|
|
- }
|
|
|
|
- return lru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
|
-func (lru *LabelRelationshipUpdate) ClearDeletedAt() *LabelRelationshipUpdate {
|
|
|
|
- lru.mutation.ClearDeletedAt()
|
|
|
|
- return lru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// SetLabelID sets the "label_id" field.
|
|
// SetLabelID sets the "label_id" field.
|
|
func (lru *LabelRelationshipUpdate) SetLabelID(u uint64) *LabelRelationshipUpdate {
|
|
func (lru *LabelRelationshipUpdate) SetLabelID(u uint64) *LabelRelationshipUpdate {
|
|
lru.mutation.SetLabelID(u)
|
|
lru.mutation.SetLabelID(u)
|
|
@@ -179,9 +159,7 @@ func (lru *LabelRelationshipUpdate) ClearLabels() *LabelRelationshipUpdate {
|
|
|
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
func (lru *LabelRelationshipUpdate) Save(ctx context.Context) (int, error) {
|
|
func (lru *LabelRelationshipUpdate) Save(ctx context.Context) (int, error) {
|
|
- if err := lru.defaults(); err != nil {
|
|
|
|
- return 0, err
|
|
|
|
- }
|
|
|
|
|
|
+ lru.defaults()
|
|
return withHooks(ctx, lru.sqlSave, lru.mutation, lru.hooks)
|
|
return withHooks(ctx, lru.sqlSave, lru.mutation, lru.hooks)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -208,15 +186,11 @@ func (lru *LabelRelationshipUpdate) ExecX(ctx context.Context) {
|
|
}
|
|
}
|
|
|
|
|
|
// defaults sets the default values of the builder before save.
|
|
// defaults sets the default values of the builder before save.
|
|
-func (lru *LabelRelationshipUpdate) defaults() error {
|
|
|
|
|
|
+func (lru *LabelRelationshipUpdate) defaults() {
|
|
if _, ok := lru.mutation.UpdatedAt(); !ok {
|
|
if _, ok := lru.mutation.UpdatedAt(); !ok {
|
|
- if labelrelationship.UpdateDefaultUpdatedAt == nil {
|
|
|
|
- return fmt.Errorf("ent: uninitialized labelrelationship.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
|
- }
|
|
|
|
v := labelrelationship.UpdateDefaultUpdatedAt()
|
|
v := labelrelationship.UpdateDefaultUpdatedAt()
|
|
lru.mutation.SetUpdatedAt(v)
|
|
lru.mutation.SetUpdatedAt(v)
|
|
}
|
|
}
|
|
- return nil
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
// check runs all checks and user-defined validators on the builder.
|
|
@@ -254,12 +228,6 @@ func (lru *LabelRelationshipUpdate) sqlSave(ctx context.Context) (n int, err err
|
|
if lru.mutation.StatusCleared() {
|
|
if lru.mutation.StatusCleared() {
|
|
_spec.ClearField(labelrelationship.FieldStatus, field.TypeUint8)
|
|
_spec.ClearField(labelrelationship.FieldStatus, field.TypeUint8)
|
|
}
|
|
}
|
|
- if value, ok := lru.mutation.DeletedAt(); ok {
|
|
|
|
- _spec.SetField(labelrelationship.FieldDeletedAt, field.TypeTime, value)
|
|
|
|
- }
|
|
|
|
- if lru.mutation.DeletedAtCleared() {
|
|
|
|
- _spec.ClearField(labelrelationship.FieldDeletedAt, field.TypeTime)
|
|
|
|
- }
|
|
|
|
if value, ok := lru.mutation.OrganizationID(); ok {
|
|
if value, ok := lru.mutation.OrganizationID(); ok {
|
|
_spec.SetField(labelrelationship.FieldOrganizationID, field.TypeUint64, value)
|
|
_spec.SetField(labelrelationship.FieldOrganizationID, field.TypeUint64, value)
|
|
}
|
|
}
|
|
@@ -380,26 +348,6 @@ func (lruo *LabelRelationshipUpdateOne) ClearStatus() *LabelRelationshipUpdateOn
|
|
return lruo
|
|
return lruo
|
|
}
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
|
-func (lruo *LabelRelationshipUpdateOne) SetDeletedAt(t time.Time) *LabelRelationshipUpdateOne {
|
|
|
|
- lruo.mutation.SetDeletedAt(t)
|
|
|
|
- return lruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
|
-func (lruo *LabelRelationshipUpdateOne) SetNillableDeletedAt(t *time.Time) *LabelRelationshipUpdateOne {
|
|
|
|
- if t != nil {
|
|
|
|
- lruo.SetDeletedAt(*t)
|
|
|
|
- }
|
|
|
|
- return lruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
|
-func (lruo *LabelRelationshipUpdateOne) ClearDeletedAt() *LabelRelationshipUpdateOne {
|
|
|
|
- lruo.mutation.ClearDeletedAt()
|
|
|
|
- return lruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// SetLabelID sets the "label_id" field.
|
|
// SetLabelID sets the "label_id" field.
|
|
func (lruo *LabelRelationshipUpdateOne) SetLabelID(u uint64) *LabelRelationshipUpdateOne {
|
|
func (lruo *LabelRelationshipUpdateOne) SetLabelID(u uint64) *LabelRelationshipUpdateOne {
|
|
lruo.mutation.SetLabelID(u)
|
|
lruo.mutation.SetLabelID(u)
|
|
@@ -509,9 +457,7 @@ func (lruo *LabelRelationshipUpdateOne) Select(field string, fields ...string) *
|
|
|
|
|
|
// Save executes the query and returns the updated LabelRelationship entity.
|
|
// Save executes the query and returns the updated LabelRelationship entity.
|
|
func (lruo *LabelRelationshipUpdateOne) Save(ctx context.Context) (*LabelRelationship, error) {
|
|
func (lruo *LabelRelationshipUpdateOne) Save(ctx context.Context) (*LabelRelationship, error) {
|
|
- if err := lruo.defaults(); err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
|
|
+ lruo.defaults()
|
|
return withHooks(ctx, lruo.sqlSave, lruo.mutation, lruo.hooks)
|
|
return withHooks(ctx, lruo.sqlSave, lruo.mutation, lruo.hooks)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -538,15 +484,11 @@ func (lruo *LabelRelationshipUpdateOne) ExecX(ctx context.Context) {
|
|
}
|
|
}
|
|
|
|
|
|
// defaults sets the default values of the builder before save.
|
|
// defaults sets the default values of the builder before save.
|
|
-func (lruo *LabelRelationshipUpdateOne) defaults() error {
|
|
|
|
|
|
+func (lruo *LabelRelationshipUpdateOne) defaults() {
|
|
if _, ok := lruo.mutation.UpdatedAt(); !ok {
|
|
if _, ok := lruo.mutation.UpdatedAt(); !ok {
|
|
- if labelrelationship.UpdateDefaultUpdatedAt == nil {
|
|
|
|
- return fmt.Errorf("ent: uninitialized labelrelationship.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
|
- }
|
|
|
|
v := labelrelationship.UpdateDefaultUpdatedAt()
|
|
v := labelrelationship.UpdateDefaultUpdatedAt()
|
|
lruo.mutation.SetUpdatedAt(v)
|
|
lruo.mutation.SetUpdatedAt(v)
|
|
}
|
|
}
|
|
- return nil
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
// check runs all checks and user-defined validators on the builder.
|
|
@@ -601,12 +543,6 @@ func (lruo *LabelRelationshipUpdateOne) sqlSave(ctx context.Context) (_node *Lab
|
|
if lruo.mutation.StatusCleared() {
|
|
if lruo.mutation.StatusCleared() {
|
|
_spec.ClearField(labelrelationship.FieldStatus, field.TypeUint8)
|
|
_spec.ClearField(labelrelationship.FieldStatus, field.TypeUint8)
|
|
}
|
|
}
|
|
- if value, ok := lruo.mutation.DeletedAt(); ok {
|
|
|
|
- _spec.SetField(labelrelationship.FieldDeletedAt, field.TypeTime, value)
|
|
|
|
- }
|
|
|
|
- if lruo.mutation.DeletedAtCleared() {
|
|
|
|
- _spec.ClearField(labelrelationship.FieldDeletedAt, field.TypeTime)
|
|
|
|
- }
|
|
|
|
if value, ok := lruo.mutation.OrganizationID(); ok {
|
|
if value, ok := lruo.mutation.OrganizationID(); ok {
|
|
_spec.SetField(labelrelationship.FieldOrganizationID, field.TypeUint64, value)
|
|
_spec.SetField(labelrelationship.FieldOrganizationID, field.TypeUint64, value)
|
|
}
|
|
}
|