jimmyyem 2 miesięcy temu
rodzic
commit
8ca786d024

+ 4 - 4
ent/migrate/schema.go

@@ -1050,10 +1050,10 @@ var (
 		{Name: "agent_id", Type: field.TypeUint64, Default: 0},
 		{Name: "agent_id", Type: field.TypeUint64, Default: 0},
 		{Name: "api_base", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "api_base", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "api_key", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "api_key", Type: field.TypeString, Nullable: true, Default: ""},
-		{Name: "allow_list", Type: field.TypeJSON},
-		{Name: "group_allow_list", Type: field.TypeJSON},
-		{Name: "block_list", Type: field.TypeJSON},
-		{Name: "group_block_list", Type: field.TypeJSON},
+		{Name: "allow_list", Type: field.TypeJSON, Nullable: true},
+		{Name: "group_allow_list", Type: field.TypeJSON, Nullable: true},
+		{Name: "block_list", Type: field.TypeJSON, Nullable: true},
+		{Name: "group_block_list", Type: field.TypeJSON, Nullable: true},
 	}
 	}
 	// WhatsappTable holds the schema information for the "whatsapp" table.
 	// WhatsappTable holds the schema information for the "whatsapp" table.
 	WhatsappTable = &schema.Table{
 	WhatsappTable = &schema.Table{

+ 80 - 0
ent/mutation.go

@@ -37634,10 +37634,24 @@ func (m *WhatsappMutation) AppendedAllowList() ([]string, bool) {
 	return m.appendallow_list, true
 	return m.appendallow_list, true
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (m *WhatsappMutation) ClearAllowList() {
+	m.allow_list = nil
+	m.appendallow_list = nil
+	m.clearedFields[whatsapp.FieldAllowList] = struct{}{}
+}
+
+// AllowListCleared returns if the "allow_list" field was cleared in this mutation.
+func (m *WhatsappMutation) AllowListCleared() bool {
+	_, ok := m.clearedFields[whatsapp.FieldAllowList]
+	return ok
+}
+
 // ResetAllowList resets all changes to the "allow_list" field.
 // ResetAllowList resets all changes to the "allow_list" field.
 func (m *WhatsappMutation) ResetAllowList() {
 func (m *WhatsappMutation) ResetAllowList() {
 	m.allow_list = nil
 	m.allow_list = nil
 	m.appendallow_list = nil
 	m.appendallow_list = nil
+	delete(m.clearedFields, whatsapp.FieldAllowList)
 }
 }
 
 
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
@@ -37685,10 +37699,24 @@ func (m *WhatsappMutation) AppendedGroupAllowList() ([]string, bool) {
 	return m.appendgroup_allow_list, true
 	return m.appendgroup_allow_list, true
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (m *WhatsappMutation) ClearGroupAllowList() {
+	m.group_allow_list = nil
+	m.appendgroup_allow_list = nil
+	m.clearedFields[whatsapp.FieldGroupAllowList] = struct{}{}
+}
+
+// GroupAllowListCleared returns if the "group_allow_list" field was cleared in this mutation.
+func (m *WhatsappMutation) GroupAllowListCleared() bool {
+	_, ok := m.clearedFields[whatsapp.FieldGroupAllowList]
+	return ok
+}
+
 // ResetGroupAllowList resets all changes to the "group_allow_list" field.
 // ResetGroupAllowList resets all changes to the "group_allow_list" field.
 func (m *WhatsappMutation) ResetGroupAllowList() {
 func (m *WhatsappMutation) ResetGroupAllowList() {
 	m.group_allow_list = nil
 	m.group_allow_list = nil
 	m.appendgroup_allow_list = nil
 	m.appendgroup_allow_list = nil
+	delete(m.clearedFields, whatsapp.FieldGroupAllowList)
 }
 }
 
 
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
@@ -37736,10 +37764,24 @@ func (m *WhatsappMutation) AppendedBlockList() ([]string, bool) {
 	return m.appendblock_list, true
 	return m.appendblock_list, true
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (m *WhatsappMutation) ClearBlockList() {
+	m.block_list = nil
+	m.appendblock_list = nil
+	m.clearedFields[whatsapp.FieldBlockList] = struct{}{}
+}
+
+// BlockListCleared returns if the "block_list" field was cleared in this mutation.
+func (m *WhatsappMutation) BlockListCleared() bool {
+	_, ok := m.clearedFields[whatsapp.FieldBlockList]
+	return ok
+}
+
 // ResetBlockList resets all changes to the "block_list" field.
 // ResetBlockList resets all changes to the "block_list" field.
 func (m *WhatsappMutation) ResetBlockList() {
 func (m *WhatsappMutation) ResetBlockList() {
 	m.block_list = nil
 	m.block_list = nil
 	m.appendblock_list = nil
 	m.appendblock_list = nil
+	delete(m.clearedFields, whatsapp.FieldBlockList)
 }
 }
 
 
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
@@ -37787,10 +37829,24 @@ func (m *WhatsappMutation) AppendedGroupBlockList() ([]string, bool) {
 	return m.appendgroup_block_list, true
 	return m.appendgroup_block_list, true
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (m *WhatsappMutation) ClearGroupBlockList() {
+	m.group_block_list = nil
+	m.appendgroup_block_list = nil
+	m.clearedFields[whatsapp.FieldGroupBlockList] = struct{}{}
+}
+
+// GroupBlockListCleared returns if the "group_block_list" field was cleared in this mutation.
+func (m *WhatsappMutation) GroupBlockListCleared() bool {
+	_, ok := m.clearedFields[whatsapp.FieldGroupBlockList]
+	return ok
+}
+
 // ResetGroupBlockList resets all changes to the "group_block_list" field.
 // ResetGroupBlockList resets all changes to the "group_block_list" field.
 func (m *WhatsappMutation) ResetGroupBlockList() {
 func (m *WhatsappMutation) ResetGroupBlockList() {
 	m.group_block_list = nil
 	m.group_block_list = nil
 	m.appendgroup_block_list = nil
 	m.appendgroup_block_list = nil
+	delete(m.clearedFields, whatsapp.FieldGroupBlockList)
 }
 }
 
 
 // Where appends a list predicates to the WhatsappMutation builder.
 // Where appends a list predicates to the WhatsappMutation builder.
@@ -38193,6 +38249,18 @@ func (m *WhatsappMutation) ClearedFields() []string {
 	if m.FieldCleared(whatsapp.FieldAPIKey) {
 	if m.FieldCleared(whatsapp.FieldAPIKey) {
 		fields = append(fields, whatsapp.FieldAPIKey)
 		fields = append(fields, whatsapp.FieldAPIKey)
 	}
 	}
+	if m.FieldCleared(whatsapp.FieldAllowList) {
+		fields = append(fields, whatsapp.FieldAllowList)
+	}
+	if m.FieldCleared(whatsapp.FieldGroupAllowList) {
+		fields = append(fields, whatsapp.FieldGroupAllowList)
+	}
+	if m.FieldCleared(whatsapp.FieldBlockList) {
+		fields = append(fields, whatsapp.FieldBlockList)
+	}
+	if m.FieldCleared(whatsapp.FieldGroupBlockList) {
+		fields = append(fields, whatsapp.FieldGroupBlockList)
+	}
 	return fields
 	return fields
 }
 }
 
 
@@ -38225,6 +38293,18 @@ func (m *WhatsappMutation) ClearField(name string) error {
 	case whatsapp.FieldAPIKey:
 	case whatsapp.FieldAPIKey:
 		m.ClearAPIKey()
 		m.ClearAPIKey()
 		return nil
 		return nil
+	case whatsapp.FieldAllowList:
+		m.ClearAllowList()
+		return nil
+	case whatsapp.FieldGroupAllowList:
+		m.ClearGroupAllowList()
+		return nil
+	case whatsapp.FieldBlockList:
+		m.ClearBlockList()
+		return nil
+	case whatsapp.FieldGroupBlockList:
+		m.ClearGroupBlockList()
+		return nil
 	}
 	}
 	return fmt.Errorf("unknown Whatsapp nullable field %s", name)
 	return fmt.Errorf("unknown Whatsapp nullable field %s", name)
 }
 }

+ 4 - 4
ent/schema/whatsapp.go

@@ -27,10 +27,10 @@ func (Whatsapp) Fields() []ent.Field {
 		field.Uint64("agent_id").Default(0).Comment("模式ID"),
 		field.Uint64("agent_id").Default(0).Comment("模式ID"),
 		field.String("api_base").Optional().Default("").Comment("大模型服务地址"),
 		field.String("api_base").Optional().Default("").Comment("大模型服务地址"),
 		field.String("api_key").Optional().Default("").Comment("大模型服务密钥"),
 		field.String("api_key").Optional().Default("").Comment("大模型服务密钥"),
-		field.JSON("allow_list", []string{}).Comment("白名单"),
-		field.JSON("group_allow_list", []string{}).Comment("群白名单"),
-		field.JSON("block_list", []string{}).Comment("黑名单"),
-		field.JSON("group_block_list", []string{}).Comment("群黑名单"),
+		field.JSON("allow_list", []string{}).Optional().Comment("白名单"),
+		field.JSON("group_allow_list", []string{}).Optional().Comment("群白名单"),
+		field.JSON("block_list", []string{}).Optional().Comment("黑名单"),
+		field.JSON("group_block_list", []string{}).Optional().Comment("群黑名单"),
 	}
 	}
 }
 }
 
 

+ 40 - 0
ent/whatsapp/where.go

@@ -944,6 +944,46 @@ func APIKeyContainsFold(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldContainsFold(FieldAPIKey, v))
 	return predicate.Whatsapp(sql.FieldContainsFold(FieldAPIKey, v))
 }
 }
 
 
+// AllowListIsNil applies the IsNil predicate on the "allow_list" field.
+func AllowListIsNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIsNull(FieldAllowList))
+}
+
+// AllowListNotNil applies the NotNil predicate on the "allow_list" field.
+func AllowListNotNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotNull(FieldAllowList))
+}
+
+// GroupAllowListIsNil applies the IsNil predicate on the "group_allow_list" field.
+func GroupAllowListIsNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIsNull(FieldGroupAllowList))
+}
+
+// GroupAllowListNotNil applies the NotNil predicate on the "group_allow_list" field.
+func GroupAllowListNotNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotNull(FieldGroupAllowList))
+}
+
+// BlockListIsNil applies the IsNil predicate on the "block_list" field.
+func BlockListIsNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIsNull(FieldBlockList))
+}
+
+// BlockListNotNil applies the NotNil predicate on the "block_list" field.
+func BlockListNotNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotNull(FieldBlockList))
+}
+
+// GroupBlockListIsNil applies the IsNil predicate on the "group_block_list" field.
+func GroupBlockListIsNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIsNull(FieldGroupBlockList))
+}
+
+// GroupBlockListNotNil applies the NotNil predicate on the "group_block_list" field.
+func GroupBlockListNotNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotNull(FieldGroupBlockList))
+}
+
 // And groups predicates with the AND operator between them.
 // And groups predicates with the AND operator between them.
 func And(predicates ...predicate.Whatsapp) predicate.Whatsapp {
 func And(predicates ...predicate.Whatsapp) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.AndPredicates(predicates...))
 	return predicate.Whatsapp(sql.AndPredicates(predicates...))

+ 80 - 12
ent/whatsapp_create.go

@@ -372,18 +372,6 @@ func (wc *WhatsappCreate) check() error {
 	if _, ok := wc.mutation.AgentID(); !ok {
 	if _, ok := wc.mutation.AgentID(); !ok {
 		return &ValidationError{Name: "agent_id", err: errors.New(`ent: missing required field "Whatsapp.agent_id"`)}
 		return &ValidationError{Name: "agent_id", err: errors.New(`ent: missing required field "Whatsapp.agent_id"`)}
 	}
 	}
-	if _, ok := wc.mutation.AllowList(); !ok {
-		return &ValidationError{Name: "allow_list", err: errors.New(`ent: missing required field "Whatsapp.allow_list"`)}
-	}
-	if _, ok := wc.mutation.GroupAllowList(); !ok {
-		return &ValidationError{Name: "group_allow_list", err: errors.New(`ent: missing required field "Whatsapp.group_allow_list"`)}
-	}
-	if _, ok := wc.mutation.BlockList(); !ok {
-		return &ValidationError{Name: "block_list", err: errors.New(`ent: missing required field "Whatsapp.block_list"`)}
-	}
-	if _, ok := wc.mutation.GroupBlockList(); !ok {
-		return &ValidationError{Name: "group_block_list", err: errors.New(`ent: missing required field "Whatsapp.group_block_list"`)}
-	}
 	return nil
 	return nil
 }
 }
 
 
@@ -763,6 +751,12 @@ func (u *WhatsappUpsert) UpdateAllowList() *WhatsappUpsert {
 	return u
 	return u
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (u *WhatsappUpsert) ClearAllowList() *WhatsappUpsert {
+	u.SetNull(whatsapp.FieldAllowList)
+	return u
+}
+
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
 func (u *WhatsappUpsert) SetGroupAllowList(v []string) *WhatsappUpsert {
 func (u *WhatsappUpsert) SetGroupAllowList(v []string) *WhatsappUpsert {
 	u.Set(whatsapp.FieldGroupAllowList, v)
 	u.Set(whatsapp.FieldGroupAllowList, v)
@@ -775,6 +769,12 @@ func (u *WhatsappUpsert) UpdateGroupAllowList() *WhatsappUpsert {
 	return u
 	return u
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (u *WhatsappUpsert) ClearGroupAllowList() *WhatsappUpsert {
+	u.SetNull(whatsapp.FieldGroupAllowList)
+	return u
+}
+
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
 func (u *WhatsappUpsert) SetBlockList(v []string) *WhatsappUpsert {
 func (u *WhatsappUpsert) SetBlockList(v []string) *WhatsappUpsert {
 	u.Set(whatsapp.FieldBlockList, v)
 	u.Set(whatsapp.FieldBlockList, v)
@@ -787,6 +787,12 @@ func (u *WhatsappUpsert) UpdateBlockList() *WhatsappUpsert {
 	return u
 	return u
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (u *WhatsappUpsert) ClearBlockList() *WhatsappUpsert {
+	u.SetNull(whatsapp.FieldBlockList)
+	return u
+}
+
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
 func (u *WhatsappUpsert) SetGroupBlockList(v []string) *WhatsappUpsert {
 func (u *WhatsappUpsert) SetGroupBlockList(v []string) *WhatsappUpsert {
 	u.Set(whatsapp.FieldGroupBlockList, v)
 	u.Set(whatsapp.FieldGroupBlockList, v)
@@ -799,6 +805,12 @@ func (u *WhatsappUpsert) UpdateGroupBlockList() *WhatsappUpsert {
 	return u
 	return u
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (u *WhatsappUpsert) ClearGroupBlockList() *WhatsappUpsert {
+	u.SetNull(whatsapp.FieldGroupBlockList)
+	return u
+}
+
 // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
 // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
 // Using this option is equivalent to using:
 // Using this option is equivalent to using:
 //
 //
@@ -1109,6 +1121,13 @@ func (u *WhatsappUpsertOne) UpdateAllowList() *WhatsappUpsertOne {
 	})
 	})
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (u *WhatsappUpsertOne) ClearAllowList() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearAllowList()
+	})
+}
+
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
 func (u *WhatsappUpsertOne) SetGroupAllowList(v []string) *WhatsappUpsertOne {
 func (u *WhatsappUpsertOne) SetGroupAllowList(v []string) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1123,6 +1142,13 @@ func (u *WhatsappUpsertOne) UpdateGroupAllowList() *WhatsappUpsertOne {
 	})
 	})
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (u *WhatsappUpsertOne) ClearGroupAllowList() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearGroupAllowList()
+	})
+}
+
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
 func (u *WhatsappUpsertOne) SetBlockList(v []string) *WhatsappUpsertOne {
 func (u *WhatsappUpsertOne) SetBlockList(v []string) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1137,6 +1163,13 @@ func (u *WhatsappUpsertOne) UpdateBlockList() *WhatsappUpsertOne {
 	})
 	})
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (u *WhatsappUpsertOne) ClearBlockList() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearBlockList()
+	})
+}
+
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
 func (u *WhatsappUpsertOne) SetGroupBlockList(v []string) *WhatsappUpsertOne {
 func (u *WhatsappUpsertOne) SetGroupBlockList(v []string) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1151,6 +1184,13 @@ func (u *WhatsappUpsertOne) UpdateGroupBlockList() *WhatsappUpsertOne {
 	})
 	})
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (u *WhatsappUpsertOne) ClearGroupBlockList() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearGroupBlockList()
+	})
+}
+
 // Exec executes the query.
 // Exec executes the query.
 func (u *WhatsappUpsertOne) Exec(ctx context.Context) error {
 func (u *WhatsappUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
 	if len(u.create.conflict) == 0 {
@@ -1627,6 +1667,13 @@ func (u *WhatsappUpsertBulk) UpdateAllowList() *WhatsappUpsertBulk {
 	})
 	})
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (u *WhatsappUpsertBulk) ClearAllowList() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearAllowList()
+	})
+}
+
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
 func (u *WhatsappUpsertBulk) SetGroupAllowList(v []string) *WhatsappUpsertBulk {
 func (u *WhatsappUpsertBulk) SetGroupAllowList(v []string) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1641,6 +1688,13 @@ func (u *WhatsappUpsertBulk) UpdateGroupAllowList() *WhatsappUpsertBulk {
 	})
 	})
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (u *WhatsappUpsertBulk) ClearGroupAllowList() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearGroupAllowList()
+	})
+}
+
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
 func (u *WhatsappUpsertBulk) SetBlockList(v []string) *WhatsappUpsertBulk {
 func (u *WhatsappUpsertBulk) SetBlockList(v []string) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1655,6 +1709,13 @@ func (u *WhatsappUpsertBulk) UpdateBlockList() *WhatsappUpsertBulk {
 	})
 	})
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (u *WhatsappUpsertBulk) ClearBlockList() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearBlockList()
+	})
+}
+
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
 func (u *WhatsappUpsertBulk) SetGroupBlockList(v []string) *WhatsappUpsertBulk {
 func (u *WhatsappUpsertBulk) SetGroupBlockList(v []string) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1669,6 +1730,13 @@ func (u *WhatsappUpsertBulk) UpdateGroupBlockList() *WhatsappUpsertBulk {
 	})
 	})
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (u *WhatsappUpsertBulk) ClearGroupBlockList() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.ClearGroupBlockList()
+	})
+}
+
 // Exec executes the query.
 // Exec executes the query.
 func (u *WhatsappUpsertBulk) Exec(ctx context.Context) error {
 func (u *WhatsappUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {
 	if u.create.err != nil {

+ 72 - 0
ent/whatsapp_update.go

@@ -272,6 +272,12 @@ func (wu *WhatsappUpdate) AppendAllowList(s []string) *WhatsappUpdate {
 	return wu
 	return wu
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (wu *WhatsappUpdate) ClearAllowList() *WhatsappUpdate {
+	wu.mutation.ClearAllowList()
+	return wu
+}
+
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
 func (wu *WhatsappUpdate) SetGroupAllowList(s []string) *WhatsappUpdate {
 func (wu *WhatsappUpdate) SetGroupAllowList(s []string) *WhatsappUpdate {
 	wu.mutation.SetGroupAllowList(s)
 	wu.mutation.SetGroupAllowList(s)
@@ -284,6 +290,12 @@ func (wu *WhatsappUpdate) AppendGroupAllowList(s []string) *WhatsappUpdate {
 	return wu
 	return wu
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (wu *WhatsappUpdate) ClearGroupAllowList() *WhatsappUpdate {
+	wu.mutation.ClearGroupAllowList()
+	return wu
+}
+
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
 func (wu *WhatsappUpdate) SetBlockList(s []string) *WhatsappUpdate {
 func (wu *WhatsappUpdate) SetBlockList(s []string) *WhatsappUpdate {
 	wu.mutation.SetBlockList(s)
 	wu.mutation.SetBlockList(s)
@@ -296,6 +308,12 @@ func (wu *WhatsappUpdate) AppendBlockList(s []string) *WhatsappUpdate {
 	return wu
 	return wu
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (wu *WhatsappUpdate) ClearBlockList() *WhatsappUpdate {
+	wu.mutation.ClearBlockList()
+	return wu
+}
+
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
 func (wu *WhatsappUpdate) SetGroupBlockList(s []string) *WhatsappUpdate {
 func (wu *WhatsappUpdate) SetGroupBlockList(s []string) *WhatsappUpdate {
 	wu.mutation.SetGroupBlockList(s)
 	wu.mutation.SetGroupBlockList(s)
@@ -308,6 +326,12 @@ func (wu *WhatsappUpdate) AppendGroupBlockList(s []string) *WhatsappUpdate {
 	return wu
 	return wu
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (wu *WhatsappUpdate) ClearGroupBlockList() *WhatsappUpdate {
+	wu.mutation.ClearGroupBlockList()
+	return wu
+}
+
 // Mutation returns the WhatsappMutation object of the builder.
 // Mutation returns the WhatsappMutation object of the builder.
 func (wu *WhatsappUpdate) Mutation() *WhatsappMutation {
 func (wu *WhatsappUpdate) Mutation() *WhatsappMutation {
 	return wu.mutation
 	return wu.mutation
@@ -438,6 +462,9 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 			sqljson.Append(u, whatsapp.FieldAllowList, value)
 			sqljson.Append(u, whatsapp.FieldAllowList, value)
 		})
 		})
 	}
 	}
+	if wu.mutation.AllowListCleared() {
+		_spec.ClearField(whatsapp.FieldAllowList, field.TypeJSON)
+	}
 	if value, ok := wu.mutation.GroupAllowList(); ok {
 	if value, ok := wu.mutation.GroupAllowList(); ok {
 		_spec.SetField(whatsapp.FieldGroupAllowList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldGroupAllowList, field.TypeJSON, value)
 	}
 	}
@@ -446,6 +473,9 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 			sqljson.Append(u, whatsapp.FieldGroupAllowList, value)
 			sqljson.Append(u, whatsapp.FieldGroupAllowList, value)
 		})
 		})
 	}
 	}
+	if wu.mutation.GroupAllowListCleared() {
+		_spec.ClearField(whatsapp.FieldGroupAllowList, field.TypeJSON)
+	}
 	if value, ok := wu.mutation.BlockList(); ok {
 	if value, ok := wu.mutation.BlockList(); ok {
 		_spec.SetField(whatsapp.FieldBlockList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldBlockList, field.TypeJSON, value)
 	}
 	}
@@ -454,6 +484,9 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 			sqljson.Append(u, whatsapp.FieldBlockList, value)
 			sqljson.Append(u, whatsapp.FieldBlockList, value)
 		})
 		})
 	}
 	}
+	if wu.mutation.BlockListCleared() {
+		_spec.ClearField(whatsapp.FieldBlockList, field.TypeJSON)
+	}
 	if value, ok := wu.mutation.GroupBlockList(); ok {
 	if value, ok := wu.mutation.GroupBlockList(); ok {
 		_spec.SetField(whatsapp.FieldGroupBlockList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldGroupBlockList, field.TypeJSON, value)
 	}
 	}
@@ -462,6 +495,9 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 			sqljson.Append(u, whatsapp.FieldGroupBlockList, value)
 			sqljson.Append(u, whatsapp.FieldGroupBlockList, value)
 		})
 		})
 	}
 	}
+	if wu.mutation.GroupBlockListCleared() {
+		_spec.ClearField(whatsapp.FieldGroupBlockList, field.TypeJSON)
+	}
 	if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil {
 	if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil {
 		if _, ok := err.(*sqlgraph.NotFoundError); ok {
 		if _, ok := err.(*sqlgraph.NotFoundError); ok {
 			err = &NotFoundError{whatsapp.Label}
 			err = &NotFoundError{whatsapp.Label}
@@ -725,6 +761,12 @@ func (wuo *WhatsappUpdateOne) AppendAllowList(s []string) *WhatsappUpdateOne {
 	return wuo
 	return wuo
 }
 }
 
 
+// ClearAllowList clears the value of the "allow_list" field.
+func (wuo *WhatsappUpdateOne) ClearAllowList() *WhatsappUpdateOne {
+	wuo.mutation.ClearAllowList()
+	return wuo
+}
+
 // SetGroupAllowList sets the "group_allow_list" field.
 // SetGroupAllowList sets the "group_allow_list" field.
 func (wuo *WhatsappUpdateOne) SetGroupAllowList(s []string) *WhatsappUpdateOne {
 func (wuo *WhatsappUpdateOne) SetGroupAllowList(s []string) *WhatsappUpdateOne {
 	wuo.mutation.SetGroupAllowList(s)
 	wuo.mutation.SetGroupAllowList(s)
@@ -737,6 +779,12 @@ func (wuo *WhatsappUpdateOne) AppendGroupAllowList(s []string) *WhatsappUpdateOn
 	return wuo
 	return wuo
 }
 }
 
 
+// ClearGroupAllowList clears the value of the "group_allow_list" field.
+func (wuo *WhatsappUpdateOne) ClearGroupAllowList() *WhatsappUpdateOne {
+	wuo.mutation.ClearGroupAllowList()
+	return wuo
+}
+
 // SetBlockList sets the "block_list" field.
 // SetBlockList sets the "block_list" field.
 func (wuo *WhatsappUpdateOne) SetBlockList(s []string) *WhatsappUpdateOne {
 func (wuo *WhatsappUpdateOne) SetBlockList(s []string) *WhatsappUpdateOne {
 	wuo.mutation.SetBlockList(s)
 	wuo.mutation.SetBlockList(s)
@@ -749,6 +797,12 @@ func (wuo *WhatsappUpdateOne) AppendBlockList(s []string) *WhatsappUpdateOne {
 	return wuo
 	return wuo
 }
 }
 
 
+// ClearBlockList clears the value of the "block_list" field.
+func (wuo *WhatsappUpdateOne) ClearBlockList() *WhatsappUpdateOne {
+	wuo.mutation.ClearBlockList()
+	return wuo
+}
+
 // SetGroupBlockList sets the "group_block_list" field.
 // SetGroupBlockList sets the "group_block_list" field.
 func (wuo *WhatsappUpdateOne) SetGroupBlockList(s []string) *WhatsappUpdateOne {
 func (wuo *WhatsappUpdateOne) SetGroupBlockList(s []string) *WhatsappUpdateOne {
 	wuo.mutation.SetGroupBlockList(s)
 	wuo.mutation.SetGroupBlockList(s)
@@ -761,6 +815,12 @@ func (wuo *WhatsappUpdateOne) AppendGroupBlockList(s []string) *WhatsappUpdateOn
 	return wuo
 	return wuo
 }
 }
 
 
+// ClearGroupBlockList clears the value of the "group_block_list" field.
+func (wuo *WhatsappUpdateOne) ClearGroupBlockList() *WhatsappUpdateOne {
+	wuo.mutation.ClearGroupBlockList()
+	return wuo
+}
+
 // Mutation returns the WhatsappMutation object of the builder.
 // Mutation returns the WhatsappMutation object of the builder.
 func (wuo *WhatsappUpdateOne) Mutation() *WhatsappMutation {
 func (wuo *WhatsappUpdateOne) Mutation() *WhatsappMutation {
 	return wuo.mutation
 	return wuo.mutation
@@ -921,6 +981,9 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 			sqljson.Append(u, whatsapp.FieldAllowList, value)
 			sqljson.Append(u, whatsapp.FieldAllowList, value)
 		})
 		})
 	}
 	}
+	if wuo.mutation.AllowListCleared() {
+		_spec.ClearField(whatsapp.FieldAllowList, field.TypeJSON)
+	}
 	if value, ok := wuo.mutation.GroupAllowList(); ok {
 	if value, ok := wuo.mutation.GroupAllowList(); ok {
 		_spec.SetField(whatsapp.FieldGroupAllowList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldGroupAllowList, field.TypeJSON, value)
 	}
 	}
@@ -929,6 +992,9 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 			sqljson.Append(u, whatsapp.FieldGroupAllowList, value)
 			sqljson.Append(u, whatsapp.FieldGroupAllowList, value)
 		})
 		})
 	}
 	}
+	if wuo.mutation.GroupAllowListCleared() {
+		_spec.ClearField(whatsapp.FieldGroupAllowList, field.TypeJSON)
+	}
 	if value, ok := wuo.mutation.BlockList(); ok {
 	if value, ok := wuo.mutation.BlockList(); ok {
 		_spec.SetField(whatsapp.FieldBlockList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldBlockList, field.TypeJSON, value)
 	}
 	}
@@ -937,6 +1003,9 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 			sqljson.Append(u, whatsapp.FieldBlockList, value)
 			sqljson.Append(u, whatsapp.FieldBlockList, value)
 		})
 		})
 	}
 	}
+	if wuo.mutation.BlockListCleared() {
+		_spec.ClearField(whatsapp.FieldBlockList, field.TypeJSON)
+	}
 	if value, ok := wuo.mutation.GroupBlockList(); ok {
 	if value, ok := wuo.mutation.GroupBlockList(); ok {
 		_spec.SetField(whatsapp.FieldGroupBlockList, field.TypeJSON, value)
 		_spec.SetField(whatsapp.FieldGroupBlockList, field.TypeJSON, value)
 	}
 	}
@@ -945,6 +1014,9 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 			sqljson.Append(u, whatsapp.FieldGroupBlockList, value)
 			sqljson.Append(u, whatsapp.FieldGroupBlockList, value)
 		})
 		})
 	}
 	}
+	if wuo.mutation.GroupBlockListCleared() {
+		_spec.ClearField(whatsapp.FieldGroupBlockList, field.TypeJSON)
+	}
 	_node = &Whatsapp{config: wuo.config}
 	_node = &Whatsapp{config: wuo.config}
 	_spec.Assign = _node.assignValues
 	_spec.Assign = _node.assignValues
 	_spec.ScanValues = _node.scanValues
 	_spec.ScanValues = _node.scanValues