Skip to content

Commit

Permalink
feat: 修复主键初始化会报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
godLei6 committed Sep 4, 2023
1 parent c6a28c6 commit 71400f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dmsvr/internal/repo/relationDB/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,为空则不限定分组内的产品类型
Expand Down
2 changes: 1 addition & 1 deletion src/syssvr/internal/repo/relationDB/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"` // 邮箱
Expand Down

0 comments on commit 71400f9

Please sign in to comment.