Reference posts table for deleted_at and user_id (#8332)
This commit is contained in:
parent
20266325fc
commit
544a1379b6
|
@ -391,8 +391,8 @@ def update_users
|
|||
, MAX(p.created_at) max_created_at
|
||||
FROM posts p
|
||||
JOIN topics t ON t.id = p.topic_id AND t.archetype <> ?
|
||||
WHERE deleted_at IS NULL
|
||||
GROUP BY user_id
|
||||
WHERE p.deleted_at IS NULL
|
||||
GROUP BY p.user_id
|
||||
)
|
||||
UPDATE users
|
||||
SET first_seen_at = X.min_created_at
|
||||
|
|
Loading…
Reference in New Issue