fix unique constraints for repos and subgroups

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧
2026-04-02 20:01:05 -04:00
parent 32e8a6dfd4
commit 8d1c4890d7
2 changed files with 2 additions and 1 deletions
+1
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{
+1 -1
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"`