mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
23 lines
598 B
Go
23 lines
598 B
Go
// Copyright 2026 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package forgejo_migrations
|
|
|
|
import (
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func init() {
|
|
registerMigration(&Migration{
|
|
Description: "add resource_all_owned_repositories to table access_token",
|
|
Upgrade: addAllOwnedRepositoriesToAccessToken,
|
|
})
|
|
}
|
|
|
|
func addAllOwnedRepositoriesToAccessToken(x *xorm.Engine) error {
|
|
type AccessToken struct {
|
|
ResourceAllRepos bool `xorm:"NOT NULL DEFAULT TRUE"`
|
|
}
|
|
_, err := x.SyncWithOptions(xorm.SyncOptions{IgnoreDropIndices: true}, new(AccessToken))
|
|
return err
|
|
}
|