Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e4e54a7

Browse files
add group ID column to repository table's unique constraint
1 parent 352887f commit e4e54a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎models/migrations/v1_25/v322.go

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

88
func AddGroupColumnsToRepositoryTable(x *xorm.Engine) error {
99
type Repository struct {
10-
GroupID int64 `xorm:"DEFAULT NULL"`
10+
GroupID int64 `xorm:"UNIQUE(s) INDEX DEFAULT NULL"`
1111
GroupSortOrder int
1212
}
1313
_, 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)

AltStyle によって変換されたページ (->オリジナル) /