fix(dbfs): file modified_at should not be updated by ent

This commit is contained in:
Aaron Liu
2025-08-05 15:11:32 +08:00
parent e31a6cbcb3
commit 80b25e88ee
18 changed files with 110 additions and 350 deletions

View File

@@ -57,20 +57,6 @@ func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate {
return fc
}
// SetDeletedAt sets the "deleted_at" field.
func (fc *FileCreate) SetDeletedAt(t time.Time) *FileCreate {
fc.mutation.SetDeletedAt(t)
return fc
}
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (fc *FileCreate) SetNillableDeletedAt(t *time.Time) *FileCreate {
if t != nil {
fc.SetDeletedAt(*t)
}
return fc
}
// SetType sets the "type" field.
func (fc *FileCreate) SetType(i int) *FileCreate {
fc.mutation.SetType(i)
@@ -413,10 +399,6 @@ func (fc *FileCreate) createSpec() (*File, *sqlgraph.CreateSpec) {
_spec.SetField(file.FieldUpdatedAt, field.TypeTime, value)
_node.UpdatedAt = value
}
if value, ok := fc.mutation.DeletedAt(); ok {
_spec.SetField(file.FieldDeletedAt, field.TypeTime, value)
_node.DeletedAt = &value
}
if value, ok := fc.mutation.GetType(); ok {
_spec.SetField(file.FieldType, field.TypeInt, value)
_node.Type = value
@@ -636,24 +618,6 @@ func (u *FileUpsert) UpdateUpdatedAt() *FileUpsert {
return u
}
// SetDeletedAt sets the "deleted_at" field.
func (u *FileUpsert) SetDeletedAt(v time.Time) *FileUpsert {
u.Set(file.FieldDeletedAt, v)
return u
}
// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (u *FileUpsert) UpdateDeletedAt() *FileUpsert {
u.SetExcluded(file.FieldDeletedAt)
return u
}
// ClearDeletedAt clears the value of the "deleted_at" field.
func (u *FileUpsert) ClearDeletedAt() *FileUpsert {
u.SetNull(file.FieldDeletedAt)
return u
}
// SetType sets the "type" field.
func (u *FileUpsert) SetType(v int) *FileUpsert {
u.Set(file.FieldType, v)
@@ -863,27 +827,6 @@ func (u *FileUpsertOne) UpdateUpdatedAt() *FileUpsertOne {
})
}
// SetDeletedAt sets the "deleted_at" field.
func (u *FileUpsertOne) SetDeletedAt(v time.Time) *FileUpsertOne {
return u.Update(func(s *FileUpsert) {
s.SetDeletedAt(v)
})
}
// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (u *FileUpsertOne) UpdateDeletedAt() *FileUpsertOne {
return u.Update(func(s *FileUpsert) {
s.UpdateDeletedAt()
})
}
// ClearDeletedAt clears the value of the "deleted_at" field.
func (u *FileUpsertOne) ClearDeletedAt() *FileUpsertOne {
return u.Update(func(s *FileUpsert) {
s.ClearDeletedAt()
})
}
// SetType sets the "type" field.
func (u *FileUpsertOne) SetType(v int) *FileUpsertOne {
return u.Update(func(s *FileUpsert) {
@@ -1289,27 +1232,6 @@ func (u *FileUpsertBulk) UpdateUpdatedAt() *FileUpsertBulk {
})
}
// SetDeletedAt sets the "deleted_at" field.
func (u *FileUpsertBulk) SetDeletedAt(v time.Time) *FileUpsertBulk {
return u.Update(func(s *FileUpsert) {
s.SetDeletedAt(v)
})
}
// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (u *FileUpsertBulk) UpdateDeletedAt() *FileUpsertBulk {
return u.Update(func(s *FileUpsert) {
s.UpdateDeletedAt()
})
}
// ClearDeletedAt clears the value of the "deleted_at" field.
func (u *FileUpsertBulk) ClearDeletedAt() *FileUpsertBulk {
return u.Update(func(s *FileUpsert) {
s.ClearDeletedAt()
})
}
// SetType sets the "type" field.
func (u *FileUpsertBulk) SetType(v int) *FileUpsertBulk {
return u.Update(func(s *FileUpsert) {