diff --git a/model/task.go b/model/task.go index 4c64a529..8e2b6d0b 100644 --- a/model/task.go +++ b/model/task.go @@ -24,7 +24,7 @@ type Task struct { ID int64 `json:"id" gorm:"primary_key;AUTO_INCREMENT"` CreatedAt int64 `json:"created_at" gorm:"index"` UpdatedAt int64 `json:"updated_at"` - TaskID string `json:"task_id" gorm:"type:varchar(50);index"` // 第三方id,不一定有/ song id\ Task id + TaskID string `json:"task_id" gorm:"type:varchar(191);index"` // 第三方id,不一定有/ song id\ Task id Platform constant.TaskPlatform `json:"platform" gorm:"type:varchar(30);index"` // 平台 UserId int `json:"user_id" gorm:"index"` ChannelId int `json:"channel_id" gorm:"index"` diff --git a/model/user.go b/model/user.go index ea0584c5..d3e40fa3 100644 --- a/model/user.go +++ b/model/user.go @@ -18,7 +18,7 @@ import ( // Otherwise, the sensitive information will be saved on local storage in plain text! type User struct { Id int `json:"id"` - Username string `json:"username" gorm:"unique;index" validate:"max=12"` + Username string `json:"username" gorm:"unique;index" validate:"max=20"` Password string `json:"password" gorm:"not null;" validate:"min=8,max=20"` OriginalPassword string `json:"original_password" gorm:"-:all"` // this field is only for Password change verification, don't save it to database! DisplayName string `json:"display_name" gorm:"index" validate:"max=20"`