|
@@ -107,11 +107,19 @@ func (ltc *LabelTaggingCreate) SetNillableType(i *int) *LabelTaggingCreate {
|
|
|
}
|
|
|
|
|
|
// SetConditions sets the "conditions" field.
|
|
|
-func (ltc *LabelTaggingCreate) SetConditions(s []string) *LabelTaggingCreate {
|
|
|
+func (ltc *LabelTaggingCreate) SetConditions(s string) *LabelTaggingCreate {
|
|
|
ltc.mutation.SetConditions(s)
|
|
|
return ltc
|
|
|
}
|
|
|
|
|
|
+// SetNillableConditions sets the "conditions" field if the given value is not nil.
|
|
|
+func (ltc *LabelTaggingCreate) SetNillableConditions(s *string) *LabelTaggingCreate {
|
|
|
+ if s != nil {
|
|
|
+ ltc.SetConditions(*s)
|
|
|
+ }
|
|
|
+ return ltc
|
|
|
+}
|
|
|
+
|
|
|
// SetActionLabelAdd sets the "action_label_add" field.
|
|
|
func (ltc *LabelTaggingCreate) SetActionLabelAdd(u []uint64) *LabelTaggingCreate {
|
|
|
ltc.mutation.SetActionLabelAdd(u)
|
|
@@ -193,6 +201,10 @@ func (ltc *LabelTaggingCreate) defaults() error {
|
|
|
v := labeltagging.DefaultType
|
|
|
ltc.mutation.SetType(v)
|
|
|
}
|
|
|
+ if _, ok := ltc.mutation.Conditions(); !ok {
|
|
|
+ v := labeltagging.DefaultConditions
|
|
|
+ ltc.mutation.SetConditions(v)
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
|
|
@@ -204,9 +216,15 @@ func (ltc *LabelTaggingCreate) check() error {
|
|
|
if _, ok := ltc.mutation.UpdatedAt(); !ok {
|
|
|
return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "LabelTagging.updated_at"`)}
|
|
|
}
|
|
|
+ if _, ok := ltc.mutation.OrganizationID(); !ok {
|
|
|
+ return &ValidationError{Name: "organization_id", err: errors.New(`ent: missing required field "LabelTagging.organization_id"`)}
|
|
|
+ }
|
|
|
if _, ok := ltc.mutation.GetType(); !ok {
|
|
|
return &ValidationError{Name: "type", err: errors.New(`ent: missing required field "LabelTagging.type"`)}
|
|
|
}
|
|
|
+ if _, ok := ltc.mutation.Conditions(); !ok {
|
|
|
+ return &ValidationError{Name: "conditions", err: errors.New(`ent: missing required field "LabelTagging.conditions"`)}
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
|
|
@@ -265,7 +283,7 @@ func (ltc *LabelTaggingCreate) createSpec() (*LabelTagging, *sqlgraph.CreateSpec
|
|
|
_node.Type = value
|
|
|
}
|
|
|
if value, ok := ltc.mutation.Conditions(); ok {
|
|
|
- _spec.SetField(labeltagging.FieldConditions, field.TypeJSON, value)
|
|
|
+ _spec.SetField(labeltagging.FieldConditions, field.TypeString, value)
|
|
|
_node.Conditions = value
|
|
|
}
|
|
|
if value, ok := ltc.mutation.ActionLabelAdd(); ok {
|
|
@@ -400,12 +418,6 @@ func (u *LabelTaggingUpsert) AddOrganizationID(v uint64) *LabelTaggingUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
-// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
-func (u *LabelTaggingUpsert) ClearOrganizationID() *LabelTaggingUpsert {
|
|
|
- u.SetNull(labeltagging.FieldOrganizationID)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelTaggingUpsert) SetType(v int) *LabelTaggingUpsert {
|
|
|
u.Set(labeltagging.FieldType, v)
|
|
@@ -425,7 +437,7 @@ func (u *LabelTaggingUpsert) AddType(v int) *LabelTaggingUpsert {
|
|
|
}
|
|
|
|
|
|
// SetConditions sets the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsert) SetConditions(v []string) *LabelTaggingUpsert {
|
|
|
+func (u *LabelTaggingUpsert) SetConditions(v string) *LabelTaggingUpsert {
|
|
|
u.Set(labeltagging.FieldConditions, v)
|
|
|
return u
|
|
|
}
|
|
@@ -436,12 +448,6 @@ func (u *LabelTaggingUpsert) UpdateConditions() *LabelTaggingUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
-// ClearConditions clears the value of the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsert) ClearConditions() *LabelTaggingUpsert {
|
|
|
- u.SetNull(labeltagging.FieldConditions)
|
|
|
- return u
|
|
|
-}
|
|
|
-
|
|
|
// SetActionLabelAdd sets the "action_label_add" field.
|
|
|
func (u *LabelTaggingUpsert) SetActionLabelAdd(v []uint64) *LabelTaggingUpsert {
|
|
|
u.Set(labeltagging.FieldActionLabelAdd, v)
|
|
@@ -613,13 +619,6 @@ func (u *LabelTaggingUpsertOne) UpdateOrganizationID() *LabelTaggingUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
-func (u *LabelTaggingUpsertOne) ClearOrganizationID() *LabelTaggingUpsertOne {
|
|
|
- return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
- s.ClearOrganizationID()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelTaggingUpsertOne) SetType(v int) *LabelTaggingUpsertOne {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|
|
@@ -642,7 +641,7 @@ func (u *LabelTaggingUpsertOne) UpdateType() *LabelTaggingUpsertOne {
|
|
|
}
|
|
|
|
|
|
// SetConditions sets the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsertOne) SetConditions(v []string) *LabelTaggingUpsertOne {
|
|
|
+func (u *LabelTaggingUpsertOne) SetConditions(v string) *LabelTaggingUpsertOne {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
s.SetConditions(v)
|
|
|
})
|
|
@@ -655,13 +654,6 @@ func (u *LabelTaggingUpsertOne) UpdateConditions() *LabelTaggingUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// ClearConditions clears the value of the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsertOne) ClearConditions() *LabelTaggingUpsertOne {
|
|
|
- return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
- s.ClearConditions()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetActionLabelAdd sets the "action_label_add" field.
|
|
|
func (u *LabelTaggingUpsertOne) SetActionLabelAdd(v []uint64) *LabelTaggingUpsertOne {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|
|
@@ -1005,13 +997,6 @@ func (u *LabelTaggingUpsertBulk) UpdateOrganizationID() *LabelTaggingUpsertBulk
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
-func (u *LabelTaggingUpsertBulk) ClearOrganizationID() *LabelTaggingUpsertBulk {
|
|
|
- return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
- s.ClearOrganizationID()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetType sets the "type" field.
|
|
|
func (u *LabelTaggingUpsertBulk) SetType(v int) *LabelTaggingUpsertBulk {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|
|
@@ -1034,7 +1019,7 @@ func (u *LabelTaggingUpsertBulk) UpdateType() *LabelTaggingUpsertBulk {
|
|
|
}
|
|
|
|
|
|
// SetConditions sets the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsertBulk) SetConditions(v []string) *LabelTaggingUpsertBulk {
|
|
|
+func (u *LabelTaggingUpsertBulk) SetConditions(v string) *LabelTaggingUpsertBulk {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
s.SetConditions(v)
|
|
|
})
|
|
@@ -1047,13 +1032,6 @@ func (u *LabelTaggingUpsertBulk) UpdateConditions() *LabelTaggingUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// ClearConditions clears the value of the "conditions" field.
|
|
|
-func (u *LabelTaggingUpsertBulk) ClearConditions() *LabelTaggingUpsertBulk {
|
|
|
- return u.Update(func(s *LabelTaggingUpsert) {
|
|
|
- s.ClearConditions()
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// SetActionLabelAdd sets the "action_label_add" field.
|
|
|
func (u *LabelTaggingUpsertBulk) SetActionLabelAdd(v []uint64) *LabelTaggingUpsertBulk {
|
|
|
return u.Update(func(s *LabelTaggingUpsert) {
|