Reference posts table for deleted_at and user_id (#8332)

This commit is contained in:
Simon Cossar 2019-11-11 11:03:57 -05:00 committed by GitHub
parent 20266325fc
commit 544a1379b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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