diff options
author | Joe Chen <jc@unknwon.io> | 2023-02-07 23:39:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 23:39:00 +0800 |
commit | 133b9d90441008ee175e1f8e6369e06309e1392a (patch) | |
tree | 70f29798055962f6700ba6a93b023a8328a5eff4 /internal/db/repo_collaboration.go | |
parent | 7c453d5b3632a6bbdbd99205c518303a9e25a4e1 (diff) |
refactor(db): finish migrate methods off `user.go` (#7337)
Diffstat (limited to 'internal/db/repo_collaboration.go')
-rw-r--r-- | internal/db/repo_collaboration.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |