Browse Source

增加mysql过滤,修改角色id长度

main
QM303176530 4 years ago
parent
commit
c7f5ea3a8e
  1. 1
      server/initialize/mysql.go
  2. 2
      server/model/sys_authority.go

1
server/initialize/mysql.go

@ -28,6 +28,7 @@ func Mysql() {
} else {
gormConfig = &gorm.Config{
Logger: logger.Default.LogMode(logger.Silent),
DisableForeignKeyConstraintWhenMigrating: true,
}
}

2
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" gorm:"comment:'角色ID'"`
AuthorityId string `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;type:varchar(100)"`
AuthorityName string `json:"authorityName" gorm:"comment:'角色名'"`
ParentId string `json:"parentId" gorm:"comment:'父角色ID'"`
DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`

Loading…
Cancel
Save