瀏覽代碼

向gormv2过度 自定义类型长度使用size进行限制

QM303176530 4 年之前
父節點
當前提交
7290de07ca
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      server/model/sys_authority.go

+ 1 - 1
server/model/sys_authority.go

@@ -8,7 +8,7 @@ type SysAuthority struct {
 	CreatedAt       time.Time
 	UpdatedAt       time.Time
 	DeletedAt       *time.Time     `sql:"index"`
-	AuthorityId     string         `json:"authorityId" gorm:"not null;unique;primary_key;comment:'角色ID';type:varchar(100)"`
+	AuthorityId     string         `json:"authorityId" gorm:"not null;unique;primary_key;comment:'角色ID';size:90"`
 	AuthorityName   string         `json:"authorityName" gorm:"comment:'角色名'"`
 	ParentId        string         `json:"parentId" gorm:"comment:'父角色ID'"`
 	DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;association_jointable_foreignkey:data_authority_id"`