feat: 优化数据库迁移与添加老表迁移

This commit is contained in:
王一之
2023-07-22 00:48:41 +08:00
parent f5bb0cad3e
commit b1ab66ecf9
9 changed files with 130 additions and 32 deletions

View File

@@ -10,9 +10,9 @@ type AuthCert struct {
model.Model
Name string `json:"name"`
AuthMethod int8 `json:"authMethod"` // 1.密码 2.秘钥
Password string `json:"password"` // 密码or私钥
Passphrase string `json:"passphrase"` // 私钥口令
AuthMethod int8 `json:"authMethod"` // 1.密码 2.秘钥
Password string `json:"password" gorm:"column:password;type:varchar(4200)"` // 密码or私钥
Passphrase string `json:"passphrase"` // 私钥口令
Remark string `json:"remark"`
}

View File

@@ -7,7 +7,7 @@ type MachineScript struct {
Name string `json:"name"`
MachineId uint64 `json:"machineId"` // 机器id
Type int `json:"type"`
Description string `json:"description"` // 脚本描述
Params string `json:"params"` // 参数列表json
Script string `json:"script"` // 脚本内容
Description string `json:"description"` // 脚本描述
Params string `json:"params"` // 参数列表json
Script string `json:"script" gorm:"column:script;type:text"` // 脚本内容
}

View File

@@ -19,8 +19,8 @@ type Config struct {
model.Model
Name string `json:"name"` // 配置名
Key string `json:"key"` // 配置key
Params string `json:"params"`
Value string `json:"value"`
Params string `json:"params" gorm:"column:params;type:varchar(1000)"`
Value string `json:"value" gorm:"column:value;type:varchar(1000)"`
Remark string `json:"remark"`
}

View File

@@ -15,8 +15,8 @@ type SysLog struct {
Type int8 `json:"type"`
Description string `json:"description"`
ReqParam string `json:"reqParam"` // 请求参数
Resp string `json:"resp"` // 响应结构
ReqParam string `json:"reqParam" gorm:"column:req_param;type:varchar(1000)"` // 请求参数
Resp string `json:"resp" gorm:"column:resp;type:varchar(1000)"` // 响应结构
}
func (a *SysLog) TableName() string {