Migrate accessories to user data
- Add user_accessory as the per-user accessory inventory table. - Migrate old accessory wear records to user-owned accessory ids, including legacy common_accessory_m lookups for old installs. - Allocate default accessories for newly created users and update accessory reads to use user_accessory at runtime. - Validate accessory ownership when wearing accessories and keep existing accessory-based responses working. Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -290,6 +290,14 @@ func addUser(dbSession *xorm.Session, phone, password string, isDefault bool) (g
|
||||
}
|
||||
return loginData, loginCode, loginMsg, created, err
|
||||
}
|
||||
|
||||
err = usermodel.EnsureUserAccessories(dbSession, db.MainEng, userID, nil)
|
||||
if err != nil {
|
||||
if localSession {
|
||||
dbSession.Rollback()
|
||||
}
|
||||
return loginData, loginCode, loginMsg, created, err
|
||||
}
|
||||
}
|
||||
|
||||
// 检查用户卡组配置
|
||||
|
||||
Reference in New Issue
Block a user