mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
feat: 系统升级支持数据库自动迁移,避免手动执行升级脚本
This commit is contained in:
@@ -12,11 +12,11 @@ const (
|
||||
|
||||
type Role struct {
|
||||
model.Model
|
||||
Status int `json:"status"` // 1:可用;-1:不可用
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
Code string `json:"code"`
|
||||
Type int `json:"type"`
|
||||
Status int `json:"status" gorm:"not null;"` // 1:可用;-1:不可用
|
||||
Name string `json:"name" gorm:"size:32;not null;"`
|
||||
Remark string `json:"remark" gorm:"size:255;not null;"`
|
||||
Code string `json:"code" gorm:"size:64;not null;"`
|
||||
Type int8 `json:"type" gorm:"not null;comment:类型:1:公共角色;2:特殊角色;"`
|
||||
}
|
||||
|
||||
func (a *Role) TableName() string {
|
||||
@@ -27,11 +27,11 @@ func (a *Role) TableName() string {
|
||||
type RoleResource struct {
|
||||
model.DeletedModel
|
||||
|
||||
RoleId uint64 `json:"roleId"`
|
||||
ResourceId uint64 `json:"resourceId"`
|
||||
CreateTime *time.Time `json:"createTime"`
|
||||
CreatorId uint64 `json:"creatorId"`
|
||||
Creator string `json:"creator"`
|
||||
RoleId uint64 `json:"roleId" gorm:"not null;"`
|
||||
ResourceId uint64 `json:"resourceId" gorm:"not null;"`
|
||||
CreateTime *time.Time `json:"createTime" gorm:"not null;"`
|
||||
CreatorId uint64 `json:"creatorId" gorm:"not null;"`
|
||||
Creator string `json:"creator" gorm:"size:32;not null;"`
|
||||
}
|
||||
|
||||
func (a *RoleResource) TableName() string {
|
||||
@@ -42,11 +42,11 @@ func (a *RoleResource) TableName() string {
|
||||
type AccountRole struct {
|
||||
model.DeletedModel
|
||||
|
||||
AccountId uint64 `json:"accountId"`
|
||||
RoleId uint64 `json:"roleId"`
|
||||
CreateTime *time.Time `json:"createTime"`
|
||||
CreatorId uint64 `json:"creatorId"`
|
||||
Creator string `json:"creator"`
|
||||
AccountId uint64 `json:"accountId" gorm:"not null;"`
|
||||
RoleId uint64 `json:"roleId" gorm:"not null;"`
|
||||
CreateTime *time.Time `json:"createTime" gorm:"not null;"`
|
||||
CreatorId uint64 `json:"creatorId" gorm:"not null;"`
|
||||
Creator string `json:"creator" gorm:"size:32;not null;"`
|
||||
}
|
||||
|
||||
func (a *AccountRole) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user