Skip to content

A platform for community discussion. Free, open, simple.

Reference posts table for deleted_at and user_id (#8332)

Simon Cossar544a1379b6ef
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake
index ca8fdc94866..d10eea7f031 100644
--- a/lib/tasks/import.rake
+++ b/lib/tasks/import.rake
@@ -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