Skip to content

Commit 747dcc1

Browse files
committed
Add Migration with updated name
1 parent 66dca88 commit 747dcc1

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

models/migrations/v1_24/v317.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
// Copyright 2025 The Gitea Authors. All rights reserved.
3+
// SPDX-License-Identifier: MIT
4+
5+
package v1_24 //nolint
6+
7+
import (
8+
"xorm.io/xorm"
9+
)
10+
11+
// Permission copied from models.actions.Permission
12+
type Permission int
13+
14+
const (
15+
PermissionUnspecified Permission = iota
16+
PermissionNone
17+
PermissionRead
18+
PermissionWrite
19+
)
20+
21+
// Permissions copied from models.actions.Permissions
22+
type Permissions struct {
23+
Actions Permission `yaml:"actions"`
24+
Checks Permission `yaml:"checks"`
25+
Contents Permission `yaml:"contents"`
26+
Deployments Permission `yaml:"deployments"`
27+
IDToken Permission `yaml:"id-token"`
28+
Issues Permission `yaml:"issues"`
29+
Discussions Permission `yaml:"discussions"`
30+
Packages Permission `yaml:"packages"`
31+
Pages Permission `yaml:"pages"`
32+
PullRequests Permission `yaml:"pull-requests"`
33+
RepositoryProjects Permission `yaml:"repository-projects"`
34+
SecurityEvents Permission `yaml:"security-events"`
35+
Statuses Permission `yaml:"statuses"`
36+
}
37+
38+
func AddPermissions(x *xorm.Engine) error {
39+
type ActionRunJob struct {
40+
Permissions Permissions `xorm:"JSON TEXT"`
41+
}
42+
43+
return x.Sync(new(ActionRunJob))
44+
}

0 commit comments

Comments
 (0)