Files

25 lines
549 B
Go
Raw Permalink Normal View History

// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
2025-06-27 07:59:55 +02:00
package versioned_migration
import (
"context"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/globallock"
"xorm.io/xorm"
)
func Migrate(ctx context.Context, x *xorm.Engine) error {
// only one instance can do the migration at the same time if there are multiple instances
release, err := globallock.Lock(ctx, "gitea_versioned_migration")
if err != nil {
return err
}
defer release()
2025-08-28 00:31:21 +08:00
return migrations.Migrate(ctx, x)
}