mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
fix purge unactivated users subquery
This commit is contained in:
parent
9ee32ad03e
commit
db67c87916
1 changed files with 1 additions and 1 deletions
|
@ -1223,7 +1223,7 @@ class User < ActiveRecord::Base
|
|||
.where("created_at < ?", SiteSetting.purge_unactivated_users_grace_period_days.days.ago)
|
||||
.where("NOT admin AND NOT moderator")
|
||||
.where("NOT EXISTS
|
||||
(SELECT 1 FROM topic_allowed_users tu JOIN topics t ON t.id = tu.topic_id AND t.user_id > 0 WHERE tu.user_id = users.id)
|
||||
(SELECT 1 FROM topic_allowed_users tu JOIN topics t ON t.id = tu.topic_id AND t.user_id > 0 WHERE tu.user_id = users.id LIMIT 1)
|
||||
")
|
||||
.limit(200)
|
||||
.find_each do |user|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue