From 447cb705531efa625563fb010533d66239f8e32a Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Mon, 21 Jul 2025 23:43:17 +0800 Subject: [PATCH] feat: change some fields of organization and user to mediumtext --- object/organization.go | 6 +++--- object/user.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/object/organization.go b/object/organization.go index 079b8fd1..5cdd676d 100644 --- a/object/organization.go +++ b/object/organization.go @@ -81,12 +81,12 @@ type Organization struct { UseEmailAsUsername bool `json:"useEmailAsUsername"` EnableTour bool `json:"enableTour"` IpRestriction string `json:"ipRestriction"` - NavItems []string `xorm:"varchar(1000)" json:"navItems"` - WidgetItems []string `xorm:"varchar(1000)" json:"widgetItems"` + NavItems []string `xorm:"mediumtext" json:"navItems"` + WidgetItems []string `xorm:"mediumtext" json:"widgetItems"` MfaItems []*MfaItem `xorm:"varchar(300)" json:"mfaItems"` MfaRememberInHours int `json:"mfaRememberInHours"` - AccountItems []*AccountItem `xorm:"varchar(5000)" json:"accountItems"` + AccountItems []*AccountItem `xorm:"mediumtext" json:"accountItems"` } func GetOrganizationCount(owner, name, field, value string) (int64, error) { diff --git a/object/user.go b/object/user.go index a6f7816e..1fdcec6b 100644 --- a/object/user.go +++ b/object/user.go @@ -190,7 +190,7 @@ type User struct { WebauthnCredentials []webauthn.Credential `xorm:"webauthnCredentials blob" json:"webauthnCredentials"` PreferredMfaType string `xorm:"varchar(100)" json:"preferredMfaType"` - RecoveryCodes []string `xorm:"varchar(1000)" json:"recoveryCodes"` + RecoveryCodes []string `xorm:"mediumtext" json:"recoveryCodes"` TotpSecret string `xorm:"varchar(100)" json:"totpSecret"` MfaPhoneEnabled bool `json:"mfaPhoneEnabled"` MfaEmailEnabled bool `json:"mfaEmailEnabled"` @@ -204,7 +204,7 @@ type User struct { Roles []*Role `json:"roles"` Permissions []*Permission `json:"permissions"` - Groups []string `xorm:"groups varchar(1000)" json:"groups"` + Groups []string `xorm:"mediumtext" json:"groups"` LastChangePasswordTime string `xorm:"varchar(100)" json:"lastChangePasswordTime"` LastSigninWrongTime string `xorm:"varchar(100)" json:"lastSigninWrongTime"`