Add fix and migration
This commit is contained in:
parent
613e5387c5
commit
a610e93cc9
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue