diff options
author | JakobDev <jakobdev@gmx.de> | 2023-10-30 09:39:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 08:39:29 +0000 |
commit | c8602a8dfa05f653e7de8ed2e677c8967b8688f5 (patch) | |
tree | 832fc4977273c7b4d56b035f00c1e434904d1fb2 /models/migrations | |
parent | 0a710133cdb0d1970e8b7392d259b8c0b68896f4 (diff) | |
download | gitea-c8602a8dfa05f653e7de8ed2e677c8967b8688f5.tar.gz gitea-c8602a8dfa05f653e7de8ed2e677c8967b8688f5.zip |
Add Index to pull_auto_merge.doer_id (#27811)
Reported at https://codeberg.org/forgejo/forgejo/issues/1677
This column is used by
[deleteUser](https://github.com/go-gitea/gitea/blob/f089be91da44ee3e85fbe326a204c7c8a5df3d31/services/user/delete.go#L90).
Note: This PR contains a Migration, so we can't backport it to 1.21.
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 2 | ||||
-rw-r--r-- | models/migrations/v1_22/v282.go | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 4a06cdc73a..28e3be503b 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -548,6 +548,8 @@ var migrations = []Migration{ NewMigration("Rename user themes", v1_22.RenameUserThemes), // v281 -> v282 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 diff --git a/models/migrations/v1_22/v282.go b/models/migrations/v1_22/v282.go new file mode 100644 index 0000000000..baad9e0916 --- /dev/null +++ b/models/migrations/v1_22/v282.go @@ -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{}) +} |