Skip to content

Commit c5138fd

Browse files
committed
Increase Content field size of gpg_key and public_key to MEDIUMTEXT (go-gitea#20896)
Backport go-gitea#20896 Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL this causes issues with these large keys. Therefore increase these fields to MEDIUMTEXT. Unfortunately the migration in go-gitea#20896 cannot be backported to 1.17 so affected users will have to use `gitea doctor recreate-table gpg_key public_key` Fix go-gitea#20894 Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent ebc8801 commit c5138fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: models/asymkey/gpg_key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type GPGKey struct {
3333
OwnerID int64 `xorm:"INDEX NOT NULL"`
3434
KeyID string `xorm:"INDEX CHAR(16) NOT NULL"`
3535
PrimaryKeyID string `xorm:"CHAR(16)"`
36-
Content string `xorm:"TEXT NOT NULL"`
36+
Content string `xorm:"MEDIUMTEXT NOT NULL"`
3737
CreatedUnix timeutil.TimeStamp `xorm:"created"`
3838
ExpiredUnix timeutil.TimeStamp
3939
AddedUnix timeutil.TimeStamp

Diff for: models/asymkey/ssh_key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type PublicKey struct {
4141
OwnerID int64 `xorm:"INDEX NOT NULL"`
4242
Name string `xorm:"NOT NULL"`
4343
Fingerprint string `xorm:"INDEX NOT NULL"`
44-
Content string `xorm:"TEXT NOT NULL"`
44+
Content string `xorm:"MEDIUMTEXT NOT NULL"`
4545
Mode perm.AccessMode `xorm:"NOT NULL DEFAULT 2"`
4646
Type KeyType `xorm:"NOT NULL DEFAULT 1"`
4747
LoginSourceID int64 `xorm:"NOT NULL DEFAULT 0"`

0 commit comments

Comments
 (0)