feat: migrate IM identity and snowflake primary keys

This commit is contained in:
richjohnrambo
2026-08-18 01:15:21 +08:00
parent db322d80dd
commit bf562c7d56
27 changed files with 1071 additions and 482 deletions
+4 -1
View File
@@ -2034,7 +2034,7 @@ func validUserPrivacyPatch(patch types.UserPrivacyPatch) bool {
}
func validUserProfilePatch(patch types.UserProfilePatch) bool {
if patch.AvatarFileID == nil && patch.Nickname == nil && patch.BirthDate == nil && patch.Signature == nil && patch.Gender == nil && patch.Region == nil {
if patch.AvatarFileID == nil && patch.Nickname == nil && patch.BirthDate == nil && patch.Signature == nil && patch.Gender == nil && patch.Region == nil && patch.Email == nil {
return false
}
if patch.Nickname != nil {
@@ -2046,6 +2046,9 @@ func validUserProfilePatch(patch types.UserProfilePatch) bool {
if patch.Signature != nil && len([]rune(*patch.Signature)) > 120 {
return false
}
if patch.Email != nil && len([]rune(strings.TrimSpace(*patch.Email))) > 128 {
return false
}
return true
}
+2
View File
@@ -10,6 +10,7 @@ type UserProfile struct {
Signature string
Gender string
Region string
Email string
PublicAccount string
Version int
CreatedAt time.Time
@@ -23,6 +24,7 @@ type UserProfilePatch struct {
Signature *string
Gender *string
Region *string
Email *string
Version int
}
+2
View File
@@ -519,6 +519,8 @@ type User struct {
LastSeen *time.Time
// User agent provided when accessing the topic last time
UserAgent string
// Canonical mobile number used for registration and account recovery.
Phone string
Public any
Trusted any