Move package settings to package instead of being tied to version (#37026)
Unties settings page from package version and adds button to delete the package version Settings page now allows for deletion of entire package and it's versions as opposed to a single version Adds an API endpoint to delete the entire package with all versions from registry fixes: https://github.com/go-gitea/gitea/issues/36904 Co-Authored-By: gemini-3-flash --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -157,6 +157,12 @@ func DeleteVersionByID(ctx context.Context, versionID int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteVersionsByPackageID deletes all versions of a specific package
|
||||
func DeleteVersionsByPackageID(ctx context.Context, packageID int64) error {
|
||||
_, err := db.GetEngine(ctx).Where(builder.Eq{"package_id": packageID}).Delete(&PackageVersion{})
|
||||
return err
|
||||
}
|
||||
|
||||
// HasVersionFileReferences checks if there are associated files
|
||||
func HasVersionFileReferences(ctx context.Context, versionID int64) (bool, error) {
|
||||
return db.GetEngine(ctx).Get(&PackageFile{
|
||||
|
||||
Reference in New Issue
Block a user