|
@@ -65,20 +65,6 @@ func (lc *LabelCreate) SetNillableStatus(u *uint8) *LabelCreate {
|
|
|
return lc
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (lc *LabelCreate) SetDeletedAt(t time.Time) *LabelCreate {
|
|
|
- lc.mutation.SetDeletedAt(t)
|
|
|
- return lc
|
|
|
-}
|
|
|
-
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
-func (lc *LabelCreate) SetNillableDeletedAt(t *time.Time) *LabelCreate {
|
|
|
- if t != nil {
|
|
|
- lc.SetDeletedAt(*t)
|
|
|
- }
|
|
|
- return lc
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (lc *LabelCreate) SetType(i int) *LabelCreate {
|
|
|
lc.mutation.SetType(i)
|
|
@@ -191,9 +177,7 @@ func (lc *LabelCreate) Mutation() *LabelMutation {
|
|
|
|
|
|
// Save creates the Label in the database.
|
|
|
func (lc *LabelCreate) Save(ctx context.Context) (*Label, error) {
|
|
|
- if err := lc.defaults(); err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
+ lc.defaults()
|
|
|
return withHooks(ctx, lc.sqlSave, lc.mutation, lc.hooks)
|
|
|
}
|
|
|
|
|
@@ -220,18 +204,12 @@ func (lc *LabelCreate) ExecX(ctx context.Context) {
|
|
|
}
|
|
|
|
|
|
// defaults sets the default values of the builder before save.
|
|
|
-func (lc *LabelCreate) defaults() error {
|
|
|
+func (lc *LabelCreate) defaults() {
|
|
|
if _, ok := lc.mutation.CreatedAt(); !ok {
|
|
|
- if label.DefaultCreatedAt == nil {
|
|
|
- return fmt.Errorf("ent: uninitialized label.DefaultCreatedAt (forgotten import ent/runtime?)")
|
|
|
- }
|
|
|
v := label.DefaultCreatedAt()
|
|
|
lc.mutation.SetCreatedAt(v)
|
|
|
}
|
|
|
if _, ok := lc.mutation.UpdatedAt(); !ok {
|
|
|
- if label.DefaultUpdatedAt == nil {
|
|
|
- return fmt.Errorf("ent: uninitialized label.DefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
- }
|
|
|
v := label.DefaultUpdatedAt()
|
|
|
lc.mutation.SetUpdatedAt(v)
|
|
|
}
|
|
@@ -263,7 +241,6 @@ func (lc *LabelCreate) defaults() error {
|
|
|
v := label.DefaultOrganizationID
|
|
|
lc.mutation.SetOrganizationID(v)
|
|
|
}
|
|
|
- return nil
|
|
|
}
|
|
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
@@ -331,10 +308,6 @@ func (lc *LabelCreate) createSpec() (*Label, *sqlgraph.CreateSpec) {
|
|
|
_spec.SetField(label.FieldStatus, field.TypeUint8, value)
|
|
|
_node.Status = value
|
|
|
}
|
|
|
- if value, ok := lc.mutation.DeletedAt(); ok {
|
|
|
- _spec.SetField(label.FieldDeletedAt, field.TypeTime, value)
|
|
|
- _node.DeletedAt = value
|
|
|
- }
|
|
|
if value, ok := lc.mutation.GetType(); ok {
|
|
|
_spec.SetField(label.FieldType, field.TypeInt, value)
|
|
|
_node.Type = value
|
|
@@ -463,24 +436,6 @@ func (u *LabelUpsert) ClearStatus() *LabelUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelUpsert) SetDeletedAt(v time.Time) *LabelUpsert {
|
|
|
- u.Set(label.FieldDeletedAt, v)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelUpsert) UpdateDeletedAt() *LabelUpsert {
|
|
|
- u.SetExcluded(label.FieldDeletedAt)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelUpsert) ClearDeletedAt() *LabelUpsert {
|
|
|
- u.SetNull(label.FieldDeletedAt)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelUpsert) SetType(v int) *LabelUpsert {
|
|
|
u.Set(label.FieldType, v)
|
|
@@ -682,27 +637,6 @@ func (u *LabelUpsertOne) ClearStatus() *LabelUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelUpsertOne) SetDeletedAt(v time.Time) *LabelUpsertOne {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.SetDeletedAt(v)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelUpsertOne) UpdateDeletedAt() *LabelUpsertOne {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.UpdateDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelUpsertOne) ClearDeletedAt() *LabelUpsertOne {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.ClearDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelUpsertOne) SetType(v int) *LabelUpsertOne {
|
|
|
return u.Update(func(s *LabelUpsert) {
|
|
@@ -1088,27 +1022,6 @@ func (u *LabelUpsertBulk) ClearStatus() *LabelUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (u *LabelUpsertBulk) SetDeletedAt(v time.Time) *LabelUpsertBulk {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.SetDeletedAt(v)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
|
|
|
-func (u *LabelUpsertBulk) UpdateDeletedAt() *LabelUpsertBulk {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.UpdateDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (u *LabelUpsertBulk) ClearDeletedAt() *LabelUpsertBulk {
|
|
|
- return u.Update(func(s *LabelUpsert) {
|
|
|
- s.ClearDeletedAt()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelUpsertBulk) SetType(v int) *LabelUpsertBulk {
|
|
|
return u.Update(func(s *LabelUpsert) {
|