mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-15 10:43:21 +02:00
add group model
This commit is contained in:
parent
b7dfefe7b3
commit
4655483fb6
26
models/group/group.go
Normal file
26
models/group/group.go
Normal 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))
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user