Skip to content

Commit b83a32f

Browse files
add group ID column to repository table's unique constraint
1 parent a31a3d6 commit b83a32f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/migrations/v1_26/v324.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "xorm.io/xorm"
44

55
func AddGroupColumnsToRepositoryTable(x *xorm.Engine) error {
66
type Repository struct {
7-
GroupID int64 `xorm:"DEFAULT NULL"`
7+
GroupID int64 `xorm:"UNIQUE(s) INDEX DEFAULT NULL"`
88
GroupSortOrder int
99
}
1010
_, err := x.SyncWithOptions(xorm.SyncOptions{

models/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ type Repository struct {
220220
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
221221
ArchivedUnix timeutil.TimeStamp `xorm:"DEFAULT 0"`
222222

223-
GroupID int64 `xorm:"INDEX DEFAULT NULL"`
223+
GroupID int64 `xorm:"UNIQUE(s) INDEX DEFAULT NULL"`
224224
GroupSortOrder int `xorm:"INDEX"`
225225
}
226226

0 commit comments

Comments
 (0)