0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 18:56:28 +02:00

add group model

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-12-24 22:11:03 -05:00
parent b7dfefe7b3
commit 4655483fb6
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C

26
models/group/group.go Normal file
View File

@ -0,0 +1,26 @@
package group
import (
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
)
// Group represents a group of repositories for a user or organization
type Group struct {
ID int64 `xorm:"pk autoincr"`
OwnerID int64 `xorm:"UNIQUE(s) index"`
OwnerName string
Owner *user_model.User `xorm:"-"`
LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
Name string `xorm:"INDEX NOT NULL"`
Description string `xorm:"TEXT"`
ParentGroupID int64 `xorm:"DEFAULT NULL"`
SubGroups []*Group `xorm:"-"`
}
func (Group) TableName() string { return "repo_group" }
func init() {
db.RegisterModel(new(Group))
}