summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/repo.go b/models/repo.go
index 9aed7d7d33..fb787baeac 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1435,9 +1435,9 @@ func NotifyWatchers(act *Action) error {
// \/ \/
type Star struct {
- Id int64
- Uid int64 `xorm:"UNIQUE(s)"`
- RepoId int64 `xorm:"UNIQUE(s)"`
+ ID int64 `xorm:"pk autoincr"`
+ UID int64 `xorm:"uid UNIQUE(s)"`
+ RepoID int64 `xorm:"UNIQUE(s)"`
}
// Star or unstar repository.
@@ -1446,7 +1446,7 @@ func StarRepo(uid, repoId int64, star bool) (err error) {
if IsStaring(uid, repoId) {
return nil
}
- if _, err = x.Insert(&Star{Uid: uid, RepoId: repoId}); err != nil {
+ if _, err = x.Insert(&Star{UID: uid, RepoID: repoId}); err != nil {
return err
} else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars + 1 WHERE id = ?", repoId); err != nil {
return err