From 133b9d90441008ee175e1f8e6369e06309e1392a Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Tue, 7 Feb 2023 23:39:00 +0800 Subject: refactor(db): finish migrate methods off `user.go` (#7337) --- internal/db/repo_collaboration.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/db/repo_collaboration.go') diff --git a/internal/db/repo_collaboration.go b/internal/db/repo_collaboration.go index 8aec18dc..758b824b 100644 --- a/internal/db/repo_collaboration.go +++ b/internal/db/repo_collaboration.go @@ -14,10 +14,10 @@ import ( // Collaboration represent the relation between an individual and a repository. type Collaboration struct { - ID int64 - RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` - UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` - Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"` + ID int64 `gorm:"primary_key"` + UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL" gorm:"uniqueIndex:collaboration_user_repo_unique;index;not null"` + RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL" gorm:"uniqueIndex:collaboration_user_repo_unique;index;not null"` + Mode AccessMode `xorm:"DEFAULT 2 NOT NULL" gorm:"not null;default:2"` } func (c *Collaboration) ModeI18nKey() string { -- cgit v1.2.3