diff --git a/src/dmsvr/internal/repo/relationDB/model.go b/src/dmsvr/internal/repo/relationDB/model.go index d68bc536a..51c53a1ea 100644 --- a/src/dmsvr/internal/repo/relationDB/model.go +++ b/src/dmsvr/internal/repo/relationDB/model.go @@ -105,7 +105,7 @@ func (m *DmDeviceInfo) TableName() string { // 设备分组信息表 type DmGroupInfo struct { - GroupID int64 `gorm:"column:group_id;primary_key;type:bigint"` // 分组ID + GroupID int64 `gorm:"column:group_id;primary_key;AUTO_INCREMENT;type:bigint"` // 分组ID ParentID int64 `gorm:"column:parent_id;type:bigint;default:0;NOT NULL"` // 父组ID 0-根组 ProjectID int64 `gorm:"column:project_id;index;type:bigint;default:0;NOT NULL"` // 项目ID(雪花ID) ProductID string `gorm:"column:product_id;type:char(11);NOT NULL"` // 产品id,为空则不限定分组内的产品类型 diff --git a/src/syssvr/internal/repo/relationDB/model.go b/src/syssvr/internal/repo/relationDB/model.go index ef6d1a204..2b4399419 100644 --- a/src/syssvr/internal/repo/relationDB/model.go +++ b/src/syssvr/internal/repo/relationDB/model.go @@ -13,7 +13,7 @@ type SysExample struct { // 用户登录信息表 type SysUserInfo struct { - UserID int64 `gorm:"column:user_id;primary_key;type:BIGINT;NOT NULL"` // 用户id + UserID int64 `gorm:"column:user_id;primary_key;AUTO_INCREMENT;type:BIGINT;NOT NULL"` // 用户id UserName sql.NullString `gorm:"column:user_name;uniqueIndex;type:VARCHAR(20)"` // 登录用户名 Password string `gorm:"column:password;type:CHAR(32);NOT NULL"` // 登录密码 Email sql.NullString `gorm:"column:email;uniqueIndex;type:VARCHAR(255)"` // 邮箱