You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models/migrations
Lunny Xiao 7df09e31fa
Move issue pin to an standalone table for querying performance (#33452)
Noticed a SQL in gitea.com has a bigger load. It seems both `is_pull`
and `pin_order` are not indexed columns in the database.

```SQL
SELECT `id`, `repo_id`, `index`, `poster_id`, `original_author`, `original_author_id`, `name`, `content`, `content_version`, `milestone_id`, `priority`, `is_closed`, `is_pull`, `num_comments`, `ref`, `pin_order`, `deadline_unix`, `created_unix`, `updated_unix`, `closed_unix`, `is_locked`, `time_estimate` FROM `issue` WHERE (repo_id =?) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order
```

I came across a comment
https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296
from @delvh , which presents a more reasonable approach. Based on this,
this PR will migrate all issue and pull request pin data from the
`issue` table to the `issue_pin` table. This change benefits larger
Gitea instances by improving scalability and performance.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 week ago
..
base Refactor fixture loading for testing (#33024) 2 months ago
fixtures Remove If Exist check on migration for mssql because that syntax required SQL server 2016 (#30894) 10 months ago
v1_6 Enable more `revive` linter rules (#30608) 10 months ago
v1_7 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_8 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_9 Enable more `revive` linter rules (#30608) 10 months ago
v1_10 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_11 Enable more `revive` linter rules (#30608) 10 months ago
v1_12 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_13 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_14 Use `crypto/sha256` (#29386) 1 year ago
v1_15 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_16 Enable tenv and testifylint rules (#32852) 2 months ago
v1_17 Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 10 months ago
v1_18 Fix wrong table name (#30557) 10 months ago
v1_19 Rename `Sync2` -> `Sync` (#26479) 2 years ago
v1_20 Enable more `revive` linter rules (#30608) 10 months ago
v1_21 Make git clone URL could use current signed-in user (#33091) 2 months ago
v1_22 Enable tenv and testifylint rules (#32852) 2 months ago
v1_23 Issue time estimate, meaningful time tracking (#23113) 3 months ago
v1_24 Move issue pin to an standalone table for querying performance (#33452) 1 week ago
migrations.go Move issue pin to an standalone table for querying performance (#33452) 1 week ago
migrations_test.go Refactor the DB migration system slightly (#32344) 4 months ago