0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-11 09:15:31 +02:00

fix unique constraints for repos and subgroups

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-11-23 22:39:12 -05:00
parent b14092fe1c
commit 88fe681a5d
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ func AddGroupColumnsToRepositoryTable(x *xorm.Engine) error {
type Repository struct {
LowerName string `xorm:"UNIQUE(s) UNIQUE(g) INDEX NOT NULL"`
GroupID int64 `xorm:"UNIQUE(g) INDEX DEFAULT 0"`
OwnerID int64 `xorm:"UNIQUE(s) UNIQUE(g) index"`
GroupSortOrder int
}
_, err := x.SyncWithOptions(xorm.SyncOptions{

View File

@ -153,7 +153,7 @@ const (
// Repository represents a git repository.
type Repository struct {
ID int64 `xorm:"pk autoincr"`
OwnerID int64 `xorm:"UNIQUE(s) index"`
OwnerID int64 `xorm:"UNIQUE(s) UNIQUE(g) index"`
OwnerName string
Owner *user_model.User `xorm:"-"`
LowerName string `xorm:"UNIQUE(s) UNIQUE(g) INDEX NOT NULL"`