mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 02:09:39 +00:00
91eb14c944
by the way, remove some unnecessary "models" imports from model migration package, fix migration test model init bug (modelmigration/migrationtest/tests.go)
22 lines
480 B
Go
22 lines
480 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_24
|
|
|
|
import (
|
|
"gitea.dev/modelmigration/base"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func AddRepoUnitAnonymousAccessMode(x base.EngineMigration) error {
|
|
type RepoUnit struct { //revive:disable-line:exported
|
|
AnonymousAccessMode int `xorm:"NOT NULL DEFAULT 0"`
|
|
}
|
|
_, err := x.SyncWithOptions(xorm.SyncOptions{
|
|
IgnoreConstrains: true,
|
|
IgnoreIndices: true,
|
|
}, new(RepoUnit))
|
|
return err
|
|
}
|