mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-29 18:27:58 +08:00
change env value max length
This commit is contained in:
parent
ae9b8106a7
commit
728f58e319
@ -364,7 +364,7 @@ type TenantServiceEnvVar struct {
|
||||
ContainerPort int `gorm:"column:container_port" validate:"container_port|numeric_between:1,65535" json:"container_port"`
|
||||
Name string `gorm:"column:name;size:1024" validate:"name" json:"name"`
|
||||
AttrName string `gorm:"column:attr_name;size:1024" validate:"env_name|required" json:"attr_name"`
|
||||
AttrValue string `gorm:"column:attr_value;size:2048" validate:"env_value|required" json:"attr_value"`
|
||||
AttrValue string `gorm:"column:attr_value;type:text" validate:"env_value|required" json:"attr_value"`
|
||||
IsChange bool `gorm:"column:is_change" validate:"is_change|bool" json:"is_change"`
|
||||
Scope string `gorm:"column:scope;default:'outer'" validate:"scope|in:outer,inner,both" json:"scope"`
|
||||
}
|
||||
|
@ -885,6 +885,9 @@ func (t *TenantServiceEnvVarDaoImpl) AddModel(mo model.Interface) error {
|
||||
relation := mo.(*model.TenantServiceEnvVar)
|
||||
var oldRelation model.TenantServiceEnvVar
|
||||
if ok := t.DB.Where("service_id = ? and attr_name = ?", relation.ServiceID, relation.AttrName).Find(&oldRelation).RecordNotFound(); ok {
|
||||
if len(relation.AttrValue) > 65532 {
|
||||
relation.AttrValue = relation.AttrValue[:65532]
|
||||
}
|
||||
if err := t.DB.Create(relation).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user