From abd8c2a7ca040966f442c3c3e4b532f00b334ed3 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Wed, 7 May 2014 17:37:09 -0400
Subject: [PATCH] Bug fix

---
 models/repo.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/models/repo.go b/models/repo.go
index 1867b99038..bdfe909cfb 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -725,8 +725,8 @@ func GetCollaborators(repoName string) ([]string, error) {
 // Watch is connection request for receiving repository notifycation.
 type Watch struct {
 	Id     int64
-	UserId int64 `xorm:"UNIQUE(watch)"`
-	RepoId int64 `xorm:"UNIQUE(watch)"`
+	UserId int64 `xorm:"UNIQUE(s)"`
+	RepoId int64 `xorm:"UNIQUE(s)"`
 }
 
 // Watch or unwatch repository.
@@ -739,7 +739,7 @@ func WatchRepo(uid, rid int64, watch bool) (err error) {
 		rawSql := "UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ?"
 		_, err = orm.Exec(rawSql, rid)
 	} else {
-		if _, err = orm.Delete(&Watch{0, rid, uid}); err != nil {
+		if _, err = orm.Delete(&Watch{0, uid, rid}); err != nil {
 			return err
 		}
 		rawSql := "UPDATE `repository` SET num_watches = num_watches - 1 WHERE id = ?"