|
@@ -66,20 +66,6 @@ func (lrc *LabelRelationshipCreate) SetNillableStatus(u *uint8) *LabelRelationsh
|
|
|
return lrc
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (lrc *LabelRelationshipCreate) SetDeletedAt(t time.Time) *LabelRelationshipCreate {
|
|
|
- lrc.mutation.SetDeletedAt(t)
|
|
|
- return lrc
|
|
|
-}
|
|
|
-
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
-func (lrc *LabelRelationshipCreate) SetNillableDeletedAt(t *time.Time) *LabelRelationshipCreate {
|
|
|
- if t != nil {
|
|
|
- lrc.SetDeletedAt(*t)
|
|
|
- }
|
|
|
- return lrc
|
|
|
-}
|
|
|
-
|
|
|
// SetLabelID sets the "label_id" field.
|
|
|
func (lrc *LabelRelationshipCreate) SetLabelID(u uint64) *LabelRelationshipCreate {
|
|
|
lrc.mutation.SetLabelID(u)
|
|
@@ -157,9 +143,7 @@ func (lrc *LabelRelationshipCreate) Mutation() *LabelRelationshipMutation {
|
|
|
|
|
|
// Save creates the LabelRelationship in the database.
|
|
|
func (lrc *LabelRelationshipCreate) Save(ctx context.Context) (*LabelRelationship, error) {
|
|
|
- if err := lrc.defaults(); err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
+ lrc.defaults()
|
|
|
return withHooks(ctx, lrc.sqlSave, lrc.mutation, lrc.hooks)
|
|
|
}
|
|
|
|
|
@@ -186,18 +170,12 @@ func (lrc *LabelRelationshipCreate) ExecX(ctx context.Context) {
|
|
|
}
|
|
|
|
|
|
// defaults sets the default values of the builder before save.
|
|
|
-func (lrc *LabelRelationshipCreate) defaults() error {
|
|
|
+func (lrc *LabelRelationshipCreate) defaults() {
|
|
|
if _, ok := lrc.mutation.CreatedAt(); !ok {
|
|
|
- if labelrelationship.DefaultCreatedAt == nil {
|
|
|
- return fmt.Errorf("ent: uninitialized labelrelationship.DefaultCreatedAt (forgotten import ent/runtime?)")
|
|
|
- }
|
|
|
v := labelrelationship.DefaultCreatedAt()
|
|
|
lrc.mutation.SetCreatedAt(v)
|
|
|
}
|
|
|
if _, ok := lrc.mutation.UpdatedAt(); !ok {
|
|
|
- if labelrelationship.DefaultUpdatedAt == nil {
|
|
|
- return fmt.Errorf("ent: uninitialized labelrelationship.DefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
- }
|
|
|
v := labelrelationship.DefaultUpdatedAt()
|
|
|
lrc.mutation.SetUpdatedAt(v)
|
|
|
}
|
|
@@ -217,7 +195,6 @@ func (lrc *LabelRelationshipCreate) defaults() error {
|
|
|
v := labelrelationship.DefaultOrganizationID
|
|
|
lrc.mutation.SetOrganizationID(v)
|
|
|
}
|
|
|
- return nil
|
|
|
}
|
|
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
@@ -285,10 +262,6 @@ func (lrc *LabelRelationshipCreate) createSpec() (*LabelRelationship, *sqlgraph.
|
|
|
_spec.SetField(labelrelationship.FieldStatus, field.TypeUint8, value)
|
|
|
_node.Status = value
|
|
|
}
|
|
|
- if value, ok := lrc.mutation.DeletedAt(); ok {
|
|
|
- _spec.SetField(labelrelationship.FieldDeletedAt, field.TypeTime, value)
|
|
|
- _node.DeletedAt = value
|
|
|
- }
|
|
|
if value, ok := lrc.mutation.OrganizationID(); ok {
|
|
|
_spec.SetField(labelrelationship.FieldOrganizationID, field.TypeUint64, value)
|
|
|
_node.OrganizationID = value
|
|
@@ -415,24 +388,6 @@ func (u *LabelRelationshipUpsert) ClearStatus() *LabelRelationshipUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsert) SetDeletedAt(v time.Time) *LabelRelationshipUpsert {
|
|
|
- u.Set(labelrelationship.FieldDeletedAt, v)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelRelationshipUpsert) UpdateDeletedAt() *LabelRelationshipUpsert {
|
|
|
- u.SetExcluded(labelrelationship.FieldDeletedAt)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsert) ClearDeletedAt() *LabelRelationshipUpsert {
|
|
|
- u.SetNull(labelrelationship.FieldDeletedAt)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
// SetLabelID sets the "label_id" field.
|
|
|
func (u *LabelRelationshipUpsert) SetLabelID(v uint64) *LabelRelationshipUpsert {
|
|
|
u.Set(labelrelationship.FieldLabelID, v)
|
|
@@ -574,27 +529,6 @@ func (u *LabelRelationshipUpsertOne) ClearStatus() *LabelRelationshipUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsertOne) SetDeletedAt(v time.Time) *LabelRelationshipUpsertOne {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.SetDeletedAt(v)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelRelationshipUpsertOne) UpdateDeletedAt() *LabelRelationshipUpsertOne {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.UpdateDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsertOne) ClearDeletedAt() *LabelRelationshipUpsertOne {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.ClearDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetLabelID sets the "label_id" field.
|
|
|
func (u *LabelRelationshipUpsertOne) SetLabelID(v uint64) *LabelRelationshipUpsertOne {
|
|
|
return u.Update(func(s *LabelRelationshipUpsert) {
|
|
@@ -910,27 +844,6 @@ func (u *LabelRelationshipUpsertBulk) ClearStatus() *LabelRelationshipUpsertBulk
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsertBulk) SetDeletedAt(v time.Time) *LabelRelationshipUpsertBulk {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.SetDeletedAt(v)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelRelationshipUpsertBulk) UpdateDeletedAt() *LabelRelationshipUpsertBulk {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.UpdateDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelRelationshipUpsertBulk) ClearDeletedAt() *LabelRelationshipUpsertBulk {
|
|
|
- return u.Update(func(s *LabelRelationshipUpsert) {
|
|
|
- s.ClearDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetLabelID sets the "label_id" field.
|
|
|
func (u *LabelRelationshipUpsertBulk) SetLabelID(v uint64) *LabelRelationshipUpsertBulk {
|
|
|
return u.Update(func(s *LabelRelationshipUpsert) {
|