aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-01-15 10:19:25 +0800
committerGitHub <noreply@github.com>2024-01-15 02:19:25 +0000
commit70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72 (patch)
tree5c9f049437c1a84a402aeef3be0cb4b95dea667e /services/migrations
parente5313248a8ed967a915f072d3991b6d046badf02 (diff)
downloadgitea-70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72.tar.gz
gitea-70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72.zip
Move more functions to db.Find (#28419)
Following #28220 This PR move more functions to use `db.Find`. --------- Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/gitea_uploader_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/migrations/gitea_uploader_test.go b/services/migrations/gitea_uploader_test.go
index 3dec3a26fc..4ec0361dfb 100644
--- a/services/migrations/gitea_uploader_test.go
+++ b/services/migrations/gitea_uploader_test.go
@@ -83,22 +83,24 @@ func TestGiteaUploadRepo(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, labels, 12)
- releases, err := repo_model.GetReleasesByRepoID(db.DefaultContext, repo.ID, repo_model.FindReleasesOptions{
+ releases, err := db.Find[repo_model.Release](db.DefaultContext, repo_model.FindReleasesOptions{
ListOptions: db.ListOptions{
PageSize: 10,
Page: 0,
},
IncludeTags: true,
+ RepoID: repo.ID,
})
assert.NoError(t, err)
assert.Len(t, releases, 8)
- releases, err = repo_model.GetReleasesByRepoID(db.DefaultContext, repo.ID, repo_model.FindReleasesOptions{
+ releases, err = db.Find[repo_model.Release](db.DefaultContext, repo_model.FindReleasesOptions{
ListOptions: db.ListOptions{
PageSize: 10,
Page: 0,
},
IncludeTags: false,
+ RepoID: repo.ID,
})
assert.NoError(t, err)
assert.Len(t, releases, 1)