7ec675b480
移除Description字段上的数据库索引,因为该字段通常不需要快速查询, 这将减少数据库的存储开销并提高写入性能。
12 lines
327 B
Go
12 lines
327 B
Go
package db
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
// HostGroup 主机组
|
|
type HostGroup struct {
|
|
gorm.Model
|
|
Name string `json:"name" gorm:"not null;comment:主机组名称;index"`
|
|
Description string `json:"description" gorm:"null;comment:主机组描述"`
|
|
ParentID uint `json:"parent_id" gorm:"null;comment:父级ID;index"`
|
|
}
|