🚧 Refactor backup service
This commit is contained in:
@@ -19,6 +19,20 @@ type ThemeCreate struct {
|
||||
hooks []Hook
|
||||
}
|
||||
|
||||
// SetUUID sets the "uuid" field.
|
||||
func (_c *ThemeCreate) SetUUID(v string) *ThemeCreate {
|
||||
_c.mutation.SetUUID(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableUUID sets the "uuid" field if the given value is not nil.
|
||||
func (_c *ThemeCreate) SetNillableUUID(v *string) *ThemeCreate {
|
||||
if v != nil {
|
||||
_c.SetUUID(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *ThemeCreate) SetCreatedAt(v string) *ThemeCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -116,6 +130,13 @@ func (_c *ThemeCreate) ExecX(ctx context.Context) {
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (_c *ThemeCreate) defaults() error {
|
||||
if _, ok := _c.mutation.UUID(); !ok {
|
||||
if theme.DefaultUUID == nil {
|
||||
return fmt.Errorf("ent: uninitialized theme.DefaultUUID (forgotten import ent/runtime?)")
|
||||
}
|
||||
v := theme.DefaultUUID()
|
||||
_c.mutation.SetUUID(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
if theme.DefaultCreatedAt == nil {
|
||||
return fmt.Errorf("ent: uninitialized theme.DefaultCreatedAt (forgotten import ent/runtime?)")
|
||||
@@ -183,6 +204,10 @@ func (_c *ThemeCreate) createSpec() (*Theme, *sqlgraph.CreateSpec) {
|
||||
_node = &Theme{config: _c.config}
|
||||
_spec = sqlgraph.NewCreateSpec(theme.Table, sqlgraph.NewFieldSpec(theme.FieldID, field.TypeInt))
|
||||
)
|
||||
if value, ok := _c.mutation.UUID(); ok {
|
||||
_spec.SetField(theme.FieldUUID, field.TypeString, value)
|
||||
_node.UUID = value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(theme.FieldCreatedAt, field.TypeString, value)
|
||||
_node.CreatedAt = value
|
||||
|
||||
Reference in New Issue
Block a user