|
@@ -65,26 +65,6 @@ func (mru *MessageRecordsUpdate) ClearStatus() *MessageRecordsUpdate {
|
|
return mru
|
|
return mru
|
|
}
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
|
-func (mru *MessageRecordsUpdate) SetDeletedAt(t time.Time) *MessageRecordsUpdate {
|
|
|
|
- mru.mutation.SetDeletedAt(t)
|
|
|
|
- return mru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
|
-func (mru *MessageRecordsUpdate) SetNillableDeletedAt(t *time.Time) *MessageRecordsUpdate {
|
|
|
|
- if t != nil {
|
|
|
|
- mru.SetDeletedAt(*t)
|
|
|
|
- }
|
|
|
|
- return mru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
|
-func (mru *MessageRecordsUpdate) ClearDeletedAt() *MessageRecordsUpdate {
|
|
|
|
- mru.mutation.ClearDeletedAt()
|
|
|
|
- return mru
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// SetBotWxid sets the "bot_wxid" field.
|
|
// SetBotWxid sets the "bot_wxid" field.
|
|
func (mru *MessageRecordsUpdate) SetBotWxid(s string) *MessageRecordsUpdate {
|
|
func (mru *MessageRecordsUpdate) SetBotWxid(s string) *MessageRecordsUpdate {
|
|
mru.mutation.SetBotWxid(s)
|
|
mru.mutation.SetBotWxid(s)
|
|
@@ -413,9 +393,7 @@ func (mru *MessageRecordsUpdate) ClearMessageContact() *MessageRecordsUpdate {
|
|
|
|
|
|
// 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 (mru *MessageRecordsUpdate) Save(ctx context.Context) (int, error) {
|
|
func (mru *MessageRecordsUpdate) Save(ctx context.Context) (int, error) {
|
|
- if err := mru.defaults(); err != nil {
|
|
|
|
- return 0, err
|
|
|
|
- }
|
|
|
|
|
|
+ mru.defaults()
|
|
return withHooks(ctx, mru.sqlSave, mru.mutation, mru.hooks)
|
|
return withHooks(ctx, mru.sqlSave, mru.mutation, mru.hooks)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -442,15 +420,11 @@ func (mru *MessageRecordsUpdate) 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 (mru *MessageRecordsUpdate) defaults() error {
|
|
|
|
|
|
+func (mru *MessageRecordsUpdate) defaults() {
|
|
if _, ok := mru.mutation.UpdatedAt(); !ok {
|
|
if _, ok := mru.mutation.UpdatedAt(); !ok {
|
|
- if messagerecords.UpdateDefaultUpdatedAt == nil {
|
|
|
|
- return fmt.Errorf("ent: uninitialized messagerecords.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
|
- }
|
|
|
|
v := messagerecords.UpdateDefaultUpdatedAt()
|
|
v := messagerecords.UpdateDefaultUpdatedAt()
|
|
mru.mutation.SetUpdatedAt(v)
|
|
mru.mutation.SetUpdatedAt(v)
|
|
}
|
|
}
|
|
- return nil
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func (mru *MessageRecordsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|
func (mru *MessageRecordsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|
@@ -474,12 +448,6 @@ func (mru *MessageRecordsUpdate) sqlSave(ctx context.Context) (n int, err error)
|
|
if mru.mutation.StatusCleared() {
|
|
if mru.mutation.StatusCleared() {
|
|
_spec.ClearField(messagerecords.FieldStatus, field.TypeUint8)
|
|
_spec.ClearField(messagerecords.FieldStatus, field.TypeUint8)
|
|
}
|
|
}
|
|
- if value, ok := mru.mutation.DeletedAt(); ok {
|
|
|
|
- _spec.SetField(messagerecords.FieldDeletedAt, field.TypeTime, value)
|
|
|
|
- }
|
|
|
|
- if mru.mutation.DeletedAtCleared() {
|
|
|
|
- _spec.ClearField(messagerecords.FieldDeletedAt, field.TypeTime)
|
|
|
|
- }
|
|
|
|
if value, ok := mru.mutation.BotWxid(); ok {
|
|
if value, ok := mru.mutation.BotWxid(); ok {
|
|
_spec.SetField(messagerecords.FieldBotWxid, field.TypeString, value)
|
|
_spec.SetField(messagerecords.FieldBotWxid, field.TypeString, value)
|
|
}
|
|
}
|
|
@@ -671,26 +639,6 @@ func (mruo *MessageRecordsUpdateOne) ClearStatus() *MessageRecordsUpdateOne {
|
|
return mruo
|
|
return mruo
|
|
}
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
|
-func (mruo *MessageRecordsUpdateOne) SetDeletedAt(t time.Time) *MessageRecordsUpdateOne {
|
|
|
|
- mruo.mutation.SetDeletedAt(t)
|
|
|
|
- return mruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
|
|
-func (mruo *MessageRecordsUpdateOne) SetNillableDeletedAt(t *time.Time) *MessageRecordsUpdateOne {
|
|
|
|
- if t != nil {
|
|
|
|
- mruo.SetDeletedAt(*t)
|
|
|
|
- }
|
|
|
|
- return mruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
|
-func (mruo *MessageRecordsUpdateOne) ClearDeletedAt() *MessageRecordsUpdateOne {
|
|
|
|
- mruo.mutation.ClearDeletedAt()
|
|
|
|
- return mruo
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// SetBotWxid sets the "bot_wxid" field.
|
|
// SetBotWxid sets the "bot_wxid" field.
|
|
func (mruo *MessageRecordsUpdateOne) SetBotWxid(s string) *MessageRecordsUpdateOne {
|
|
func (mruo *MessageRecordsUpdateOne) SetBotWxid(s string) *MessageRecordsUpdateOne {
|
|
mruo.mutation.SetBotWxid(s)
|
|
mruo.mutation.SetBotWxid(s)
|
|
@@ -1032,9 +980,7 @@ func (mruo *MessageRecordsUpdateOne) Select(field string, fields ...string) *Mes
|
|
|
|
|
|
// Save executes the query and returns the updated MessageRecords entity.
|
|
// Save executes the query and returns the updated MessageRecords entity.
|
|
func (mruo *MessageRecordsUpdateOne) Save(ctx context.Context) (*MessageRecords, error) {
|
|
func (mruo *MessageRecordsUpdateOne) Save(ctx context.Context) (*MessageRecords, error) {
|
|
- if err := mruo.defaults(); err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
|
|
+ mruo.defaults()
|
|
return withHooks(ctx, mruo.sqlSave, mruo.mutation, mruo.hooks)
|
|
return withHooks(ctx, mruo.sqlSave, mruo.mutation, mruo.hooks)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1061,15 +1007,11 @@ func (mruo *MessageRecordsUpdateOne) 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 (mruo *MessageRecordsUpdateOne) defaults() error {
|
|
|
|
|
|
+func (mruo *MessageRecordsUpdateOne) defaults() {
|
|
if _, ok := mruo.mutation.UpdatedAt(); !ok {
|
|
if _, ok := mruo.mutation.UpdatedAt(); !ok {
|
|
- if messagerecords.UpdateDefaultUpdatedAt == nil {
|
|
|
|
- return fmt.Errorf("ent: uninitialized messagerecords.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
|
|
|
|
- }
|
|
|
|
v := messagerecords.UpdateDefaultUpdatedAt()
|
|
v := messagerecords.UpdateDefaultUpdatedAt()
|
|
mruo.mutation.SetUpdatedAt(v)
|
|
mruo.mutation.SetUpdatedAt(v)
|
|
}
|
|
}
|
|
- return nil
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func (mruo *MessageRecordsUpdateOne) sqlSave(ctx context.Context) (_node *MessageRecords, err error) {
|
|
func (mruo *MessageRecordsUpdateOne) sqlSave(ctx context.Context) (_node *MessageRecords, err error) {
|
|
@@ -1110,12 +1052,6 @@ func (mruo *MessageRecordsUpdateOne) sqlSave(ctx context.Context) (_node *Messag
|
|
if mruo.mutation.StatusCleared() {
|
|
if mruo.mutation.StatusCleared() {
|
|
_spec.ClearField(messagerecords.FieldStatus, field.TypeUint8)
|
|
_spec.ClearField(messagerecords.FieldStatus, field.TypeUint8)
|
|
}
|
|
}
|
|
- if value, ok := mruo.mutation.DeletedAt(); ok {
|
|
|
|
- _spec.SetField(messagerecords.FieldDeletedAt, field.TypeTime, value)
|
|
|
|
- }
|
|
|
|
- if mruo.mutation.DeletedAtCleared() {
|
|
|
|
- _spec.ClearField(messagerecords.FieldDeletedAt, field.TypeTime)
|
|
|
|
- }
|
|
|
|
if value, ok := mruo.mutation.BotWxid(); ok {
|
|
if value, ok := mruo.mutation.BotWxid(); ok {
|
|
_spec.SetField(messagerecords.FieldBotWxid, field.TypeString, value)
|
|
_spec.SetField(messagerecords.FieldBotWxid, field.TypeString, value)
|
|
}
|
|
}
|