Skip to content

Commit 8863e74

Browse files
authored
Fix organization watch migration (#2703)
1 parent e89bb7e commit 8863e74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/migrations/v46.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func removeOrganizationWatchRepo(x *xorm.Engine) error {
2525
if err := sess.Begin(); err != nil {
2626
return err
2727
}
28-
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 {
28+
if _, err := sess.Exec("DELETE FROM `watch` WHERE `user_id` IN (SELECT `id` FROM `user` WHERE `type` = ?)", UserTypeOrganization); err != nil {
2929
return err
3030
}
3131
if _, err := sess.Exec("UPDATE `repository` SET num_watches = (SELECT count(*) FROM watch WHERE `repository`.`id` = watch.repo_id)"); err != nil {

0 commit comments

Comments
 (0)