修复:软删除账号可复用用户名
This commit is contained in:
@@ -19,7 +19,9 @@ type User struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
|
||||
Username string `gorm:"uniqueIndex;size:64;not null" json:"username"`
|
||||
// Username uniqueness is enforced by a partial database index for active
|
||||
// accounts, allowing a username to be reused after its old account is soft deleted.
|
||||
Username string `gorm:"size:64;not null" json:"username"`
|
||||
PasswordHash string `gorm:"size:255;not null" json:"-"`
|
||||
Nickname string `gorm:"size:64" json:"nickname"`
|
||||
Role string `gorm:"size:32;not null;default:merchant" json:"role"`
|
||||
|
||||
Reference in New Issue
Block a user