1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix DatabaseMysql 新增的 From字段 不允许为空 但未设置默认值 导致已存在数据库的1panel升级时无法正常启动 (#1772)

Co-authored-by: 邵传波 <shaocb@mail.unitid.cn>
This commit is contained in:
longyuan 2023-07-27 13:58:08 +08:00 committed by GitHub
parent 1a6c45c526
commit 2a20ff0b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ package model
type DatabaseMysql struct {
BaseModel
Name string `json:"name" gorm:"type:varchar(256);not null"`
From string `json:"type" gorm:"type:varchar(256);not null"`
From string `json:"type" gorm:"type:varchar(256);not null;default:'local'"`
MysqlName string `json:"mysqlName" gorm:"type:varchar(64);not null"`
Format string `json:"format" gorm:"type:varchar(64);not null"`
Username string `json:"username" gorm:"type:varchar(256);not null"`