mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 18:17:54 +01:00
Add Index to pull_auto_merge.doer_id (#27811)
Reported at https://codeberg.org/forgejo/forgejo/issues/1677
This column is used by
[deleteUser](f089be91da/services/user/delete.go (L90)
).
Note: This PR contains a Migration, so we can't backport it to 1.21.
This commit is contained in:
parent
0a710133cd
commit
c8602a8dfa
@ -548,6 +548,8 @@ var migrations = []Migration{
|
|||||||
NewMigration("Rename user themes", v1_22.RenameUserThemes),
|
NewMigration("Rename user themes", v1_22.RenameUserThemes),
|
||||||
// v281 -> v282
|
// v281 -> v282
|
||||||
NewMigration("Add auth_token table", v1_22.CreateAuthTokenTable),
|
NewMigration("Add auth_token table", v1_22.CreateAuthTokenTable),
|
||||||
|
// v282 -> v283
|
||||||
|
NewMigration("Add Index to pull_auto_merge.doer_id", v1_22.AddIndexToPullAutoMergeDoerID),
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current db version
|
// GetCurrentDBVersion returns the current db version
|
||||||
|
16
models/migrations/v1_22/v282.go
Normal file
16
models/migrations/v1_22/v282.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package v1_22 //nolint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"xorm.io/xorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AddIndexToPullAutoMergeDoerID(x *xorm.Engine) error {
|
||||||
|
type PullAutoMerge struct {
|
||||||
|
DoerID int64 `xorm:"INDEX NOT NULL"`
|
||||||
|
}
|
||||||
|
|
||||||
|
return x.Sync(&PullAutoMerge{})
|
||||||
|
}
|
@ -17,7 +17,7 @@ import (
|
|||||||
type AutoMerge struct {
|
type AutoMerge struct {
|
||||||
ID int64 `xorm:"pk autoincr"`
|
ID int64 `xorm:"pk autoincr"`
|
||||||
PullID int64 `xorm:"UNIQUE"`
|
PullID int64 `xorm:"UNIQUE"`
|
||||||
DoerID int64 `xorm:"NOT NULL"`
|
DoerID int64 `xorm:"INDEX NOT NULL"`
|
||||||
Doer *user_model.User `xorm:"-"`
|
Doer *user_model.User `xorm:"-"`
|
||||||
MergeStyle repo_model.MergeStyle `xorm:"varchar(30)"`
|
MergeStyle repo_model.MergeStyle `xorm:"varchar(30)"`
|
||||||
Message string `xorm:"LONGTEXT"`
|
Message string `xorm:"LONGTEXT"`
|
||||||
|
Loading…
Reference in New Issue
Block a user