diff options
author | Lauris BH <lauris@nix.lv> | 2017-10-14 20:47:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-14 20:47:05 +0300 |
commit | 8863e74f2aa7150605712eb21468b6f1305289f7 (patch) | |
tree | 894d3c987081033493f3f647abb36589227badf8 /models/migrations | |
parent | e89bb7ef6a6848615a56f8c568ae335de0c2e9e7 (diff) | |
download | gitea-8863e74f2aa7150605712eb21468b6f1305289f7.tar.gz gitea-8863e74f2aa7150605712eb21468b6f1305289f7.zip |
Fix organization watch migration (#2703)
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/v46.go | 2 |
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 { |