mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 15:14:40 +09:00
Gitea picks the latest release by commit date, while GitHub keeps an explicit pointer, so repositories migrated from GitHub could show a different latest release than their source. Fixes https://github.com/go-gitea/gitea/issues/35273. - Add a "Set as Latest Release" checkbox and GitHub's `make_latest` API option. Without them, the newest stable release by commit date stays the latest. - Migrations from GitHub and Gitea carry over the source's latest release. - Migrated releases are dated by their commit like native ones, and equally dated ones keep the source's order. <img width="355" height="122" alt="Set as Latest Release checkbox" src="https://github.com/user-attachments/assets/d35f5324-7ae0-4e9f-b73c-d3c90496fb00" /> --------- Co-authored-by: silverwind <me@silverwind.io>
24 lines
495 B
Go
24 lines
495 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v29
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dev/modelmigration/base"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func AddLatestReleaseIDToRepository(_ctx context.Context, engine base.EngineMigration) error {
|
|
type Repository struct {
|
|
LatestReleaseID int64 `xorm:"NOT NULL DEFAULT 0"`
|
|
}
|
|
_, err := engine.SyncWithOptions(xorm.SyncOptions{
|
|
IgnoreDropIndices: true,
|
|
IgnoreConstrains: true,
|
|
}, new(Repository))
|
|
return err
|
|
}
|