summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-10-14 20:47:05 +0300
committerGitHub <noreply@github.com>2017-10-14 20:47:05 +0300
commit8863e74f2aa7150605712eb21468b6f1305289f7 (patch)
tree894d3c987081033493f3f647abb36589227badf8 /models/migrations
parente89bb7ef6a6848615a56f8c568ae335de0c2e9e7 (diff)
downloadgitea-8863e74f2aa7150605712eb21468b6f1305289f7.tar.gz
gitea-8863e74f2aa7150605712eb21468b6f1305289f7.zip
Fix organization watch migration (#2703)
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/v46.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/migrations/v46.go b/models/migrations/v46.go
index 3cc35a300f..b6dd059c94 100644
--- a/models/migrations/v46.go
+++ b/models/migrations/v46.go
@@ -25,7 +25,7 @@ func removeOrganizationWatchRepo(x *xorm.Engine) error {
if err := sess.Begin(); err != nil {
return err
}
- if _, err := sess.Exec("DELETE FROM watch WHERE id IN (SELECT watch.id FROM watch INNER JOIN user ON watch.user_id = user.id WHERE `user`.`type` = ?)", UserTypeOrganization); err != nil {
+ if _, err := sess.Exec("DELETE FROM `watch` WHERE `user_id` IN (SELECT `id` FROM `user` WHERE `type` = ?)", UserTypeOrganization); err != nil {
return err
}
if _, err := sess.Exec("UPDATE `repository` SET num_watches = (SELECT count(*) FROM watch WHERE `repository`.`id` = watch.repo_id)"); err != nil {