mirror of
1
Fork 0

Add fix and migration

This commit is contained in:
JakobDev 2024-04-04 10:40:25 +02:00
parent 613e5387c5
commit a610e93cc9
2 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,8 @@ var migrations = []*Migration{
NewMigration("Add the `apply_to_admins` column to the `protected_branch` table", forgejo_v1_22.AddApplyToAdminsSetting), NewMigration("Add the `apply_to_admins` column to the `protected_branch` table", forgejo_v1_22.AddApplyToAdminsSetting),
// v9 -> v10 // v9 -> v10
NewMigration("Add pronouns to user", forgejo_v1_22.AddPronounsToUser), NewMigration("Add pronouns to user", forgejo_v1_22.AddPronounsToUser),
// v11 -> v12
NewMigration("Add repo_archive_download_count table", forgejo_v1_22.AddRepoArchiveDownloadCount),
} }
// GetCurrentDBVersion returns the current Forgejo database version. // GetCurrentDBVersion returns the current Forgejo database version.

View File

@ -74,6 +74,9 @@ func GetArchiveDownloadCount(ctx context.Context, repoID, releaseID int64) (*api
func GetArchiveDownloadCountForTagName(ctx context.Context, repoID int64, tagName string) (*api.TagArchiveDownloadCount, error) { func GetArchiveDownloadCountForTagName(ctx context.Context, repoID int64, tagName string) (*api.TagArchiveDownloadCount, error) {
release, err := GetRelease(ctx, repoID, tagName) release, err := GetRelease(ctx, repoID, tagName)
if err != nil { if err != nil {
if IsErrReleaseNotExist(err) {
return new(api.TagArchiveDownloadCount), nil
}
return nil, err return nil, err
} }